Kawa automatically decides how to run an applet or application based on the following rule -
If there is no project open and the current open file in the editor is a Java file then the open file is run as a Java app. This requires the current open file to have a static 'main' method to run it as a class. However, if the current file open is an HTML file then the file is run as an applet. This requires that the HTML file has the correct Applet tag with the name of the class to run.
If there is a project open, Kawa checks for the name of the run class under project interpreter options first. If this field is empty Kawa next checks for main class file or main HTML file in the same order. If none of these are successful in returning a file name or a class name, Kawa parses all the project Java files looking for a class with a main method. Kawa then runs the first class that has a main method.
If the run class name is empty and if there is no main HTML file or main class file set and if there is no class in the project which has a main method defined then Kawa will search the product for an Applet derived class. If a class is found that is derived from Applet then Kawa prompts to create an HTML file to run this class as an applet in the Appletviewer.
In order to select a main class file for a project, click right button on a project Java file in the project tree and select main class from the context menu. Follow the same steps for selecting a main HTML file but instead select a project HTML file and then select main HTML from the context menu.
Kawa can add a default HTML file for the project with the name of the main class as the applet to run. Select Project/Default HTML to add a default HTML file to the project. If there is no main class defined or selected in the project then the Applet tag is left empty in the default HTML file. Please fill the appropriate class name in the default HTML file before trying to run the applet.
Interpreter options can be set globally for all projects and non project Java files. This is done by right clicking on the root "Kawa Projects" item in the project tree. These options will apply for all single Java files and Kawa projects. However, any project option will supersede the global option. Please refer to