Introduction to Code Warrior

Here is a description of how to use Code Warrior to create and run a Java program (application) that converts Fahrenheit temperatures to Centigrade (Celcius). 
Once Code Warrior is started (click the START button, then select PROGRAMS and finally the CodeWarrior icon), select New from the File menu (see the image on the left). This should bring up the new file dialog box. In the new file dialog box, select Java Application Wizard.
Type a Project name in the textbox on the right side of this new file window. The image on the right shows the result of naming the project FahrenheitToCentigrade, which is just the class name. You can name the project whatever you like, but a descriptive name will likely come in handy.
In the same window, note the location of the project. If you click in the location text-field, you can use the arrow keys to see the entire path of the location. If you wish to change the location (you probably will), click the Set... button.

When you have given a name and a location to your project file, click the OK button.

In the new window that appears (see the figure on the right), the name of your client class should be substituted for Application1. In this example it will be FahrenheitToCentigrade

The Package name should be deleted (otherwise a package line will be added to the beginning of the program which is not discussed in our book). 

Uncheck the Create a frame on startup check box, otherwise a GUI design tool similar to Visual Basic will appear upon startup. When you've named your class and unchecked the box, select the Next button.

The second page of the New Java application wizard should appear. Filling in an Application title (again descriptive titles are best) and a Description causes a comment to appear in every file of the project, both a word title and description. 

When finished giving the title and a description, click Finish. A box appears that states what Code Warrior will do and asks whether the skelton program should be generated. Click Generate in this next summary window.

The project then appears with a skeleton program called FahrenheitToCentigrade.java. The project window for our example is shown on the right. In the project window, if you double click on a *.java file, you will open an editor window for that file. In that editor window, you can add code for your class file and the BreezyGUI commands you desire.
On the otherhand, if the code for your class file already exists, you can delete the FahrenheitToCentigrade.java file (click on the file in the project window and press the Delete key). To add files to a project, activate the project window (by clicking in it) and select Add Files ... from the Project menu. For now, just accept the offerings that CodeWarrior presents to you.

We will need to add the entire BreezyGUI library to each project we create. One way to accomplish this is to drag the BreezyGUI folder onto the project window as follows:

  1. Reduce the size of the Code Warrior window so that you can see some of your desktop.
  2. Using Windows Explorer, or by navigating via MyComputer, open the folder that contains the BreezyGUI subfolder. One such location should be G:\MathCS (the DropFolders drive).
  3. Now resize and move windows if necessary so that you can see both the BreezyGUI folder and your CodeWarrior project window.
  4. Finally, drag the BreezyGUI folder into the project window.
Using the File menu, save your project. CodeWarrior will create a *.mcp file (Metrowerks Codewarrior Project) in the location you selected above. Once you have entered code in your class file, you can compile and run your application by selecting Run from CodeWarrior's Project menu.
 
After a while, the following brief directions should get you started on creating a new project with Code Warrior.
  1. Start CodeWarrior.
  2. From the File menu, select New and then choose Java Application.
  3. Type in a project name and set the location.
  4. Type in the class name, clear the package name and clear the create a frame checkbox.
  5. Type in a title and a description of the project and finally select generate.