| Home Introduction Using Holon Holon Tools Contact UsingHolonJ |
Applications
and Applets
You can create Java applications and applets in HolonJ. Here are some observations. Minimal ApplicationAn application is a class with a main method.
Application with a windowIf an object of the class is created, the method <init> is called for initializing. At the very least <init> initializes the super object.
If an identifier contains a dot, only the part of the identifier following the dot is used in the class file. Thus HolonJ sees "MyApp.<init>", Java sees "<init>". Minimal AppletAn applet is a class that extends the class Applet and runs in a browser. The browser loads the applet, creates an object and calls the init method of the applet.
Useful AppletRunning as a thread, no user input
Games, User action
Running the Applet as an ApplicationThe applet can run as an application, if we provide a context with a window. The java interpreter does not provide a full applet context (e.g. no sound), but it serves well for the initial tests.
The window close button is not active. Close the window with Ctrl+C in the console window. Or add a window adapter class as in Calculator.
|
|
| © 2000 Wolf Wejgaard |