Quit Metrowerks Java each time you run an applet or program.
Application
- Click on the arrow next to Sources to open the Sources folder in the Project Window.
- Add desired files by choosing Add Files from the Project Menu. Then move the added files to the Sources folder.
- Remove TrivialAppication.java by selecting it and choosing Remove Selected Items from the Project menu.
- Go to Java application settings under the Edit menu, select Java Target, and change the name of the Main Class. (Remember that Java is case sensitive.)
- Choose Run from the Project menu.
Applet
Most of the steps are the same as the above. Refer to How to change a Java Application to an Applet to determine how to write Java applets.
- Click on the arrow next to Sources to open the Sources folder in the Project Window.
- Modify the "TrivialApplet.html" file so that the name of your applet
is used instead of the name "TrivialApplet"
- Modify the width and height sizes in "TrivialApplet.html" to your desired sizes.
- The "codebase" tag within the HTML file tells the computer where to find the compiled file. By default, Codewarrior puts it in a folder called TrivialApplet. It is easiest to let Codewarrior place the compiled java file in the TrivialApplet folder, but you can change this option.
- Remove TrivialApplet.java by selecting it and choosing Remove Selected Items from the Project menu.
- Add desired files by choosing Add Files from the Project Menu. Then move the added files to the Sources folder.
- Choose Run from the Project menu.