![]() |
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: