JavaSoft

Java

I've gone out and found myself a big book on Java (It must be good, its 5 cm thick!), and started to play around. Here's some of the stuff I've done.

Random Names

The first thing I tried was an applet for my homepage. You give it a list of names, and it cycles through at random. It was written in both Java and JavaScript - this was a long time ago, back when most of the Durham University terminals here couldn't handle proper Java!

[Class file] [Java source]

Countdown

The next homepage applet was a countdown to the Year 2000. Very simple really - it could be modified for any significant date. I wrote it in Java first, but only put up the JavaScript version, because I couldn't be bothered to make both work on the same page when the uni machines still could only use one type.

[Class file] [Java source] [JavaScript source]

Fadeout

The third homepage applet was a JavaScript fadeout. It worked by setting timers which cycle the background colour, black to white. As that finished, an HTTP Refresh command in a META tag loaded the main homepage. By using white text on the initial black background, the page washes out before being replaced by the main site.

[JavaScript source]

Trevs WebRing

WebRing Applet - link to active site This applet can now be found on most Trevs websites and looks like the image to the right. It implements a WebRing, allowing users to tour round sites associated with Trevelyan College. By using a central site database the ring can grow or have addresses change without having to modify code on every linked site or rebuild the applet.

When loaded, it downloads a list of other sites from the main Trevs website and assigns some of these to buttons. The sites are arranged as a logical ring, the applet learning its own position through a parameter passed by the calling web page. It decides which the next site in the ring is in either direction, and links buttons to these URLs. The graphical buttons are made by displaying one of two .gif images (up/down), downloaded from the same site as the Applet. For those browsers that can use it, all the files are available in a .jar archive to speed download.

The WebRing can be seen in action at http://www.dur.ac.uk/TrevsJCR/WebRing/.

Mandelbrot Applet

The Mandelbrot bug to the left has been dynamically generated. I designed it to work as a dynamic wallpaper for Windows 98. The version here is small to make it load quickly, but can be resized to any dimension. It comes as two class files, one to draw the Mandelbrot, and another as a generic complex maths class. I've put both into an archive with source and HTML code for simplicity of downloading.

While running, one thread creates the image, whilst another handles the display, speeding up the calculation loop. If the area to be drawn is a symmetric, both halves will be drawn simultaneously, to save time.

[ZIP archive]


BackBack to Homepage