Main Content

Java - from applets to servlets. JSPs and more

Archive - Originally posted on "The Horse's Mouth" - 2010-02-27 08:00:20 - Graham Ellis

When Java first came out in the mid 1990s, its main focus was on Applets - embedded chunks of applications that ran (and still run!) in a frame within a browser's window in much the same say that an image or flash movie is framed.

Java has progressed. It now has a far bigger 'market' in a whole range of other areas, such as server side programming in the form or Servlets and JSPs. And as it has progressed, so have our training courses - we do retain a handful of applet examples in our current notes, but most of our delegates - including all of those on the week just completed - are looking at the Server side of things. See [here] for details of our current "Java Bootcamp" conversion course (from other languages) and [here] if you're learning to program in Java without prior programming experience.

But that doesn't mean that applets, and graphic stand alone applications in Java have gone away completely, nor that people don't want to find examples of Jtree objects and mouseMoved methods from Swing and from the AWT. And delegates who came on courses many years ago may still wish to find the examples from the training notes, way back, to check up on an algorithm or two.

So the old examples - clearly marked "archived" in each case - may be found on our resources pages [here]. For those readers with old notes, you can look them up by name - the names are in your manuals. And for everyone - here's a starter example. Our "waxwing" graphic application (the Java examples were named after birds!) draws a bar chart of data supplied on the command line, with highlights of notable events also supplied as parameters. You can then click on a column of data to get a readout of the value, and you can redraw it as a line graph or as a scatter (spot) plot. The application will read from data supplied as applet parameters too so that it can be embedded in a web page.

The source code for the waxwing applet is [here] and the html if you want to embed it in a web page (and including the data shown) is [here].

I am not going to pretend that all the examples in this particular module are up to date - they're using old HTML standards, deprecated tags, and the Java compiler too will tell you that there are things that need updating. Yes - we know and we would not use these examples on current training courses without an update! They're archives here ;-).


The command that I ran to produce the graph and labels above:

java waxwing values=" 4453, 6528, 5678, 8244, 9831, 6712, 6498, 6167, 5768, 5157, 5169, 5306, 6249, 8504, 7141, 5879, 5329, 5273, 6506, 5130, 4915, 5465, 6413, 5262, 6226, 5234, 5272, 6301, 6495, 6487, 6441, 6497, 6341, 5780, 7519, 7029, 7398, 7519, 7470, 7346, 9352, 7199, 7935, 8335, 7804, 6618, 6147, 6553, 6173, 5847, 5680, 4291, 3939, 2874, 3708, 3445, 3426, 3406, 3352, 3709, 3698, 3459, 3490, 2610, 2904, 2808, 2479, 2590, 3149, 2344, 2761, 2435, 2134, 1812, 3000, 7308, 7970, 8574, 10020, 11330, 3730, 4125, 4150, 3770, 3521" title="Thames and Severn Canal - Annual Income" base="1797" 1800="Opening of Kennet and Avon Canal" 1819="Opening of the North Wilts Canal in April" 1840="Building of the Swindon and Cirencester railway" 1854="Conversion of the Forest of Dean railway to broad gauge" 1875="T & S Company again became carriers"