Technical: Java
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Title



Previous Section Table of Contents Next Section



Step 2 - Building the ImageButton

The ImageButton class is the first of several classes that implement the button behavior used in all of our controls. This is the base class that contains basic behavior, such as the ability to load and display images.

If you have not already done so, close the AboutDialog window in the Finder, and open the ImageButton folder in the Source Clippings folder. You may need to resize and reposition the window so that all of the clippings are visible. Now open the ImageButton.java skeleton file by double-clicking on the corresponding file in the project window of CodeWarrior. You may need to rearrange your window so that you can see the ImageButton clipping folder in the Finder.

Now you are ready to start the source modifications in the section Building the Image Button.

Once you complete these steps, close the source file and clipping folder before proceeding to Step 3.


Back to top



Step 3 - Building the RolloverButton

The RolloverButton class extends the ImageButton class to provide multiple-state information within the button.

As we have done before, close the ImageButton folder and open the RolloverButton Source Clipping folder. Open the RolloverButton.java from the Project window before proceeding to the next set of steps in the section Building the RolloverButton.


Back to top


Step 4 - Building the Forward Button

The ForwardButton class extends the RolloverButton class. It customizes the behavior in that class in order to specify a unique set of images to be used for its display.

Before proceeding to the steps for the Forward Button, close any open source files, and open the ForwardButton.java source file and the ForwardButton Source Clipping folder in the Finder. Once again, you may need to resize or reposition your windows to make optimal use of your screen real estate. Once this preparation is completed, proceed to the steps in the section Building the Forward Button.


Back to top


Step 5 - Building the Backward Button

The BackwardButton class is very similar to the ForwardButton class, except that we specify a different series of image files.

Once again, close any open source files and open the BackwardButton.java skeleton file. Open the BackwardButton Source Clipping folder in the Finder.

After completing this step, proceed to the steps in the section Building the Backward Button.


Back to top


Step 6 - Building the Play/Pause Button

While related to the BackwardButton and ForwardButton, and also derived from RolloverButton, the PlayPauseButton class is slightly more complex. Since it is a two-state toggle button, it has some additional functionality to facilitate handing this additional state.

Before proceeding to the steps for the Play/Pause Button, close any open source files, and open the PlayPauseButton.java source file and the PlayPauseButton Source Clipping folder in the Finder. Once again, you may need to resize or reposition your windows to make optimal use of your screen real estate. Once this preparation is completed, proceed to the steps in the section Building the Play/Pause Button.


Back to top




Previous Section Table of Contents Next Section



[an error occurred while processing this directive]