JCQ Java

Tuesday, September 05, 2006

Playing with Java

Java is a programming language. There is no point in learning another programming language if you are not interested in it. So I just want you to start playing with Java, to get an idea what Java is all about.

Java source code is compiled to class file(s). Class files are run by JVM - Java Virtual Machine, a piece of software in the JDK. This is quite technical. However, every modern browser has a JVM inside. This means that browsers can run little Java programs, or "applets" in Java-speak. Therefore, as long as you have a browser (e.g. IE or FF), you can run Java applets.

The JDK comes with a set of applet demos, located under [java]\demo (or somewhere similar). There you can find a lot of applets, under different folders. For example, TicTacToe is under the folder:

[java]\demo\applets\TicTacToe [java] is where you install JDK.

Once you are in a demo applet folder, you can double-click the webpage (.html) to put the page on the browser, and thereby loads and runs the applet.

Security is a built-in feature of Java. This means applets cannot do any harm to the computer. Therefore, choose from any applet folder, and run to see what it is -- this cannot do anything bad to the computer.

All applets are interactive, so use mouse clicks to see effects. For now, don't worry about how to write such Java applets. Just try out the applets and appreciate what Java can do.

Besides TicTacToe, my favourite demo applet is MoleculeViewer. There you can use the mouse to rotate a chemical molecule in 3-dimensions.

Discover your favourite demo applet, and see Java in action.

0 Comments:

Post a Comment

<< Home