Developing Java Applications: A Tutorial | Creating a Custom View Class

Completing the Application

Add Images to the Project

The TempImageView object must, of course, have images to show. Ready-made "climate" images come provided for this tutorial. You must add these image files to the application.

  1. In Project Builder, double-click the Images category in the project browser.
  2. In the Add Images panel, navigate to the following directory:

    /System/Documentation/Developer/Cocoa/JavaTutorial/ApplicationImages

    If you are on a Yellow Box for Windows system, the above path starts with the value of NEXT_ROOT rather than /System .

  3. Add the following images: Hot.tiff , Cold.tiff , Moderate.tiff .

    Shift-click each file to select all images, then click OK to add them to the project.

  4. Choose Save from the Project menu.

Build the Project

Now you're ready to build the project. Click the Build button in the project window, then the same button in the Build panel. You can circumvent these buttons by pressing Command-Shift-B. If there are errors in the code, they will appear in the two lower displays of the Build panel. Click a line describing an error in the upper display to go to the line in the code containing the error; fix the error and rebuild.

Related Concepts

Test Drive the Application

Launch the TemperatureConverter application and see what it can do; this includes not only what you specifically programmed it to do, but the behavior the application gets "for free."

Now check out the "free" behavior.


Previous | Next
© 1998 Apple Computer, Inc.