What is the current release of Java? Is it Java 1.6, Java 2 (1.6) or Java 6? Yes it is - they're all different names for the same thing!
Java started out as Java 1.0 ... and since code that would run on that Virtual Machine / written in that language will still run on today's version, it's still technically "Java 1". But would you seriously 'buy' a product that's not had a major revision in more than a dozen years? You would think twice ... and so it was that the marketing gurus switched to the "Java 2" name, and then to "Java 5" for 1.5 and "Java 6" for 1.6. And in some ways that makes huge sense beyond the marketing side too, because Java 6 is a very different beast to Java 1.0
Java 1.0's main use was in Applets - code running within a user's browser, sandboxed into an internal frame within a browser window and with carefully limited access beyond that frame. A very close parallel to
Flash these days. But things have moved on ... Java has moved from browser / client side through to server side, where it's running complete applications (perhaps under Tomcat through the Servlet / JSP interface, tag libraries, Struts, Spring and the rest!)
From its early days, Java supported graphics through the AWT - Abstract Windowing Toolkit - a useful but low level interface. You call methods to paint with a
Graphic object on a
Frame object - methods with name like
setcolor and
drawLine and
drawString. If you're working at this level, you'll be using pixel addressing so you'll find that you're providing your own utility methods with names like
toXPixel and
toYPixel - mapping world to screen coordinates; there's an example of such an applet
here.
So is such graphics useful now that most Java runs on the server? It turns out that
yes, it is!. As well as working on a Frame within a browser window, Java can work on a psuedoFrame in memory ... and then that frame can be stored as - for example - a .jpg file. We have an example of such a Servlet (for that's what it is)
here. Technically, it uses a
BufferedImage object, on which you run a
createGraphics - it took me a while to work out the first time, but the example I'm pointing you at (link on "here") has all the hard word done for you and produces a graphic of data that the server extracts from MySQL database table. A truly 'put it all together' application!
(written 2009-06-17 08:56:12)
Associated topics are indexed under
J802 - Java - Abstract Windowing Toolkit [2654] Java - from applets to servlets. JSPs and more - (2010-02-27)
[2649] Length, size or capacity in Java? - (2010-02-24)
[1325] Java - Client side applet applications as well as server side - (2007-08-29)
J807 - Java - ImagesJ953 - Combined Java Web Example: Servlets, JDBC and Graphics [1466] Effective Java training - the bootcamp approach - (2007-12-09)
Q913 - Object Orientation and General technical topics - Computer Graphics Principles [2633] Why do I teach niche skills rather than mainstream? - (2010-02-13)
Some other Articles
Public Transport from London to Melksham, WiltshireGetting home from MelkshamA day in the life of a hotelierWhat difference does using the XHTML standard really make?Client side (Applet) and Server side (Servlet) Graphics in JavaWhat should a web site cost you?Changing a variable behaviour in Perl - tieingSo what is this thing called Perl that I keep harping on about?Perl references - $$var and \$var notationsHow do I query a database (MySQL)?