Creating a basic application

For creating a basic application, in Java we need a class having a method called main which accepts possible parameters from the standard Java Runtime Environemt (JRE). This basically is done by the class described in App.java.

Besides providing the application's main method, App.class constructs an instance of the main frame of application SimplyHTML, an instance of the class defined by FrmMain.java, and initially displays it.

When application SimplyHTML is started, the Java Runtime Environment opens the main thread for this aplication and executes method main of class App. Once all steps such as constructing the application's main frame, control is transferred to the event dispatching thread.

Setting a look and feel

An important feature of Java is to support different system platforms making it necessary to design applications independent from any system specific behaviour. The author of a Java application can not predict, on which system the application actually will be used.

Java provides mechanisms to keep applications away from proprietary look and feels or behaviours with class UIManager of package javax.swing. App.class of SimplyHTML uses methods setLookAndFeel and getSystemLookAndFeelClassName of class UIManager to initially set the look and feel to the one of the system, the application is started on.

By setting the L&F at runtime in the application's main method, an application can be kept independent from system specific behaviour. Class UIManager still allows to change L&F settings later in a session with the application if necessary.