As explained at the start of this chapter, there's no real need for a Java SE version of the CarControls client, but it's useful for debugging and testing the server. Figure 10-25 shows the GUI for BlueCarControls (the Java SE code), which replicates the look of CarControls fairly closely (see Figure 10-21).
Class diagrams for BlueCarControls are shown in Figure 10-26, and should be compared to the diagrams for CarControls in Figure 10-23.
The top-level UIApplication on BlackBerry has become a JFrame in Java SE, while the Field subclass is now a JPanel called ButtonPanel.
ButtonPanel draws active and inactive button images by overriding paintComponent(), while the BlackBerry version overrides paint(). The main difference in ButtonPanel is the use of MouseEvents to govern the changing of the images, while PictureButton utilizes RIM's navigationClick events.
The public methods in ClipsPlayer look unchanged between the two clients, but the Java SE version uses a HashMap of AudioClips internally rather than a Hashtable of Player objects in the BlackBerry code.
Was this article helpful?