Java Help
Content
As we all know
JAVA is the product of
Sun. It becomes to be the new programming standard for web
applications. It also required as a basic programming language for various of CS courses, such
as
CS542,
CS561,
CS536 etc.
Ok, now assume we are going to do the JAVA project for our courses. We usually have following
choices. We can select one of the following UNIX machines, or we can do it on a PC. Here is a
list of UNIX machines and the versions of JAVA virtual machine installed on it.
Machine |
Version of Java Virtual Machine |
penguin.wpi.edu |
1.1.4 |
bert.wpi.edu |
1.2.2-1 (J2SDK.v.1.2.2:09/30/1999-19:00, native threads, jit_122) |
falcon.wpi.edu |
1.2 (JavaVM-1.2_NIGHTLY_1999.03.31, native threads,
sunwjit) |
crane.wpi.edu |
1.2.1 (Solaris_JDK_1.2.1_03, native threads, sunwjit) |
toucan.wpi.edu |
1.2.1 (Solaris_JDK_1.2.1_03, native threads, sunwjit) |
wpi.wpi.edu |
1.2.2-2 (J2SDK.v.1.2.2:09/30/1999-19:00, native threads, jit_122) |
reno.wpi.edu |
1.2.2-2 (J2SDK.v.1.2.2:09/30/1999-19:00, native threads, jit_122) |
Books:
Hmm, there are a lot of good JAVA books you can get
start. These are the books that I used very often.
- Java In a Nutshell, 2nd Edition, David Flanagan, O'REILLY, ISBN
1-56592-262-X
- Beginning Java, Ivor Horton, WROX, ISBN 1-861000-27-8
- JDBC Developer's Resource, Art Taylor, INFORMIX Press, ISBN 0-13-842352-0
Want more about tutorial books? Check:
http://java.sun.com/docs/books/tutorial/book.html.
In general, Sun has suggested a list of books about JAVA programming. The address is at:
http://java.sun.com/docs/books.
External References: There are a lot references from Sun's homepage. Here
we selected some of the most popular accessed web sites as the reference.
Internal References: There are also a lot of machines that already
have some version of the documents downloaded. If you want a faster access, then
you can try the following links:
The CS-GSO has conducted a Java-Tutorial on October 25, 1999. This
section contains the material that was prepared for the tutorial. It
also contains a number of Java programs that were not presented in the
lecture. They cover a large part of what you are likely to need in
Java.
As always: To download something rather than just seeing it on the
screen, hold the SHIFT-key while clicking.
- The overheads
that were used for the tutorial (PostScript, view with
ghostview
). Explains differences with Java and C, why
to use Java, and some introduction into the language.
- A handout that explains
how to get started with Java.
-
Basic Java Concepts.
- The essential Hello-World program. Use
this to try out the Java-compiler.
- An introduction to
object-oriented concepts. This is commented code, read the
comments in order of the numbers of the comments and it should give
you a rough idea of some OO concepts. If you can predict what this
program prints, you understand object-oriented programming.
- An introduction to GUI
programming using the Swing-AWT. Graphical User Interfaces are
easily programmed using the Swing-Package (Java Foundation Classes
- JFC). This is a short program that explains some concepts. To
compile it, you need Java 1.2 (or the swingall.jar library under
Java 1.1.x) program. Again, read in order of the numbers. Note that
the
appletviewer
on crane, toucan, falcon
takes about 5 minutes to start. In order to do meaningful
development, you should start the appletviewer only once and then
reload the applet everytime you compiled. That is much
faster. Run this applet by typing appletviewer
SwingGUI.html
. The
html-file that you need is here. Since this is a Java 1.2
applet, it will not run in Netscape (you have to write applets in
Java 1.1 if you want them to run in current browsers).
- An introduction to
Java-exceptions. This was not part of the tutorial lecture.
-
Some Advanced Concepts.
- Networking. This code is a simple
HTTP-client. It downloads a HTML-Page from a web server with given
URL and outputs it to
stdout
.
- Animation. This code shows a very simple
application of Java's threads. It animates a simple
graphical applet.
- Databases. This code shows how to use
Java and JDBC to communicate with a database system. In order to
run this code, you need a database connectivity package (such as
Oracle's JDBC-Thin-Client) in the
classpath
and, of course, an account on a database
server.
-
Incremental Java: The Mandelbrot Applet
This section contains different steps of an applet that draws the
Mandelbrot set (a fractal). It goes from easy to complicated,
introducing elements like mouse click handling and colors along the
way. This code is not blessed with a lot of comments, just take it
as an example of coding and play with it. Again, you need the
appletviewer and a lot of time to see anything on the screen, but
it's worth it :)
I did put the class-Files here so the
applets should work in your browser, but remember that this is
experimental code, they may behave weirdly. Be patient, some of
them are quite slow.
- Mandelbrot 1. Draws a black rectangle on an applet; pixel by pixel:
Code and
HTML-File.
- Mandelbrot 2. Draws the original Mandelbrot set: Code and
HTML-File.
- Mandelbrot 3. Zooms into the set after a mouse click. Also
much faster due to the elimination of the SQRT-Function: Code and
HTML-File.
- Mandelbrot 4. 16-Color version (with color table): Code and
HTML-File.
- Mandelbrot 5. 256-Color version. Continuous colors. Cool!!!: Code and
HTML-File.
- Mandelbrot 6. Right mouse button zooms out. Buffering the
image, so it doesn't recompute everytime the applet repaints: Code and
HTML-File.
- Mandelbrot 7. Animates the process of building the
image. Makes the whole thing look faster (although it's actually slower): Code and
HTML-File.
Last modified by CS-GSO,
Sunday, 27-Nov-2005 09:05:43 EST