Struct 1
Struct 2
Struct 3 Events AWT
Project AWT
Project
Supplementary Swing
Sound/Parameters
Java is a platform
independent language. It uses a virtual machine that runs as an "operating
system within an operating system" on different platforms. Because of this
virtual machine, Java programs can be written and compiled once, and then
utilized in many environments.
Java code is passed to each virtual machine, which takes care translating it
into instructions and commands that can be understood on whatever operating
system the virtual machine happens to be installed on. It is a "fire-and-forget", "one-size-fits-all"
IDE where you may code a
project and that code will run without alteration on any platform. At least,
that is what Java's creators aspire to. Rather than
compiling ASCII source into machine code and instruction sets as C and C++
compilers do, the Java compiler converts ASCII source into "byte code". Byte
code is an intermediary state between true binary machine code and code that
would be run through an interpreter such as with scripting languages like
JavaScript and VBScript. The topic is still disputed among various parties
concerning whether Java is a truly compiled language or whether it should be
considered an interpreted language through its virtual machine. It might be
closer to the truth to say it falls into a gray area somewhere between compiled
stand-alone languages and interpreted ones.
Designed with adaptability
and flexibiliity as a goal, Java is wired for platform independence.
This makes it a great choice for distributed applications on the web. In
contrast, applications written in C and C++ must be re-written and recompiled
for each platform they are utilized on. Java's platform independence feature come at the expense of performance, since
more system resources are required to support both the virtual machine and the client operating
system it is running on. In effect, you are running two operating systems
simultaneously with Java. Even so,
for applications that need to be quickly
distributed across the internet or a wide variety of operating system platforms
- Java presents an
excellent option to the developer.
If
you are just getting started in Java, you are probably most familiar with
"applets", an implementation of Java that allows embedding a Java program into a
web page. While many times an applet is just what you want,
a good deal of animation and other "fluff" that applets used to accomplish is
being replaced by Macromedia's FLASH MX and ActionScript. These
technologies utilize vector graphics and servers to do everything from animating
images on a web page and creating games to creating full-blown online databases
using combinations of FLASH™, ActionScript™
and ColdFusion™. What is moving this trend is not only the blazing fast
performance, smoothness and quick load times of MacroMedia's vector graphics,
but also dramatically reduced development times. In contrast to primitive
development tools, Macromedia's development products present an intuitive and easy to use interface and many pre-defined
functions and methods that the developer can utilize with the mere click of a
mouse. Amazingly, for animations and simple web projects, no typing of source is
even necessary! Entire expressions can be built by clicking on pre-assembled
code snippets and selected objects and property sheets. This dramatically increases the speed with which a project can be
developed, and therefore exponentially reduces the cost of developing an
application. ( By the way, Macromedia also makes a product called "Director",
which
allows you to easily create animations, programs and games and then export the
projects as Java code! )
In addition to creating platform independent applications and
internet-savvy applets, Java is highly effective for
programming small, embedded systems and hardware devices. It was
originally designed to do just that in its conceptual phase (known as the
"Stealth Project"). Java code can
be
optimized to compete with C++ and Visual Basic, but this comes at the cost of
losing its platform independence. C++ programmers will have no trouble
learning Java, as it is about 80% C++. Many times snippets of C++ code can
be pasted into a Java compiler and they will actually compile without a hitch!
This is due to the fact that Java was developed from C++, and so shares a great
deal of the attribute and structure of its more powerful parent. As a matter of
fact, if you are fairly fluent in C++, you can run through basic console tutorials
very quickly using your C++ knowledge. Then you may wish to go directly to
the Abstract Windows Toolkit (AWT). This too can be compared to
Microsoft's MFC which you learned in C++. In many respects, the logic and
concepts are identical and only the names have been changed. Examples:
MFC: Calls it a "Message handler", mapping a message ID to a message
handler.
AWT: Calls it an "Event handler", mapping an event to an
event handler.
Remember what we've already established, in this industry no one is innocent and
everyone's a pirate reverse engineering, expanding, and redeploying everyone
else's technology. Einstein is quoted as saying himself that, "The secret to
creativity is in hiding all of your sources." It appears most software and
hardware developers embrace Einstein's philosophy with relish. If you haven't
seen it, check out the movie "The
Pirates of Silicon Valley". It is in many places fictional, but it does a fairly
decent job of telling the story of how we got where we are today
through so many dirty deeds of swashbuckling software and hardware piracy.
Still, we as a society benefit from this chaos and the competition it engenders
drives technological evolution and revolution.
All you need to learn to program in Java is
available for FREE. It will cost you nothing. In
this aspect, it embraces the ideals and has a large following among those in the
open source community. It is available, pre-installed on most versions of Linux.
I use Linux Fedora Core 5 on my laptop and desktop multi-boots, and the OS comes
with excellent free Java development tools. For my XP and 2003 partitions, I use
the freely downloadable
JDK from Sun and a free visual interface to the
JDK
called "Forte".
Whether Linux or Windows, there is nothing to buy. Learning
and developing in Java won't cost you a dime. Alternatively, if you absolutely
want to fork over some cash, you will find many Java tools and compilers for
sale. Google
it!
Unlike C++, Java does not use
pointers. (In actuality, it does, as you will see if you know C++, but it hides
this implementation from you with a bit of VooDoo.) Java's
System.gc()
method will take care of cleaning up memory, so unlike C++, your
classes will not need destructors and you don't have to worry about setting
dangling pointers to NULL or calling delete on objects instantiated on the heap.
Materials you will need to learn and develop in Java:
1. Any simple text editor or word processor.
2.
Sun's
free
Java
SDK 1.3.1 or above (a FREE download).
3. Optionally -
Sun's
free
Forte 3.0 Community
Edition. An excellent free GUI visual development tool for
the SDK.
Note: Did I mention that these items are
FREE?
:) Free. Free. Free. They are all free!
SDK - You can write and compile Java with just the SDK if
you are a right-wing whacko, sadistic, nazi
text-based freak with no life and too much time who
thinks web developers should never have a connection faster than
14.4 Kbps and that the internet should be nothing more than a
plain, ASCII text database without any graphics or cool embedded
objects, whatsoever. I actually have friends who are
like this and I feel sorry for them. Still, if you were stranded
on a deserted island with nothing but a primitive computer, a simple text
editor, a command console, and the JRE and JDK - you could still develop Java
software! Yeah baby! It's called basic survival...
:-)
Of course, there's the nicer way,
the GUI, the pretty colors... It's much more comforting to
binge on aesthetically pleasing menus and point and click your
way into glory among soothing pastel images and color coded key
words. Ah, the comforts of civilization. So you may want to use:
Forte - Forte is a GUI visual interface, that with
the JDK makes a pretty decent IDE. Install it after you
have installed the Java SDK and you will have a beautiful,
graphical, intuitive programming experience that will make you
weep with tears of joy and forget all about your dark, lonely,
and bleak days of staring endlessly into the blackness of a
command prompt on some archaic terminal emulator.
Oh Happy! Happy! Happy!
There are but a few other things ye need to know, ye land lubber:
Javascript - Not to be confused with Java. Netscape invented
the JavaScript programming language, and while it looks like Java sometimes,
it is most definitely not! JavaScript is strictly a scripting language
interpreted through web browsers with no stand-alone capability.
Applets - typically, the Virtual Machine for applets is built into
the browser, separate from the VM used by the OS for Java Applications.
That's about as much as I can type at one sitting, so we'll call this
the "Introduction" page and leave it at that. Download the JRE, JDK and Forte
from Sun and install them in the same order. If you want to be able to compile
Java programs in any directory, you will need to add the absolute path to the
"javac.exe" command from the JDK to your Windows PATH variable if you are on a
Microsoft operating system. You can add it under "Environment Variables" on the
"Advanced" tab for "My Computer". In Linux, just make a soft link to it and
throw it in the development folder, "etc", or wherever you like. After this, you
will be ready to move on. Welcome to the wonderful world of Java Programming!
Struct 1
Struct 2
Struct 3 Events AWT
Project
HOME AWT
Project
Supplementary Swing
Sound/Parameters
