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.
[Class file] [Java source]
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/.
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.
Back to Homepage