Java Reference
In-Depth Information
For each of these classes, the bulk of the implementation is in the initComponents
method, which is responsible for creating the various user-interface controls and posi-
tioning them in the layout. Mercifully, all of this code is generated automatically, so you
don't need to concern yourself with it in detail here.
The WeatherApplet application itself is an Xlet, similar to a MIDlet. Like MIDlets,
Xlets have a well-defined life cycle in which the application can pass through five states,
as shown in Figure 3-16. The NetBeans-generated code includes reference implementa-
tions for the Xlet method that implement the state transitions, saving you the need to
write anything as you first get things going. You'll learn all about Xlets in Chapter 9.
Figure 3-16. The life cycle of an Xlet
Wiring up the Back button in the SettingPanel class is trickier; to do this, create a
controller that's responsible for managing transitions between the different panels of
the user interface. The controller is responsible for hiding and showing each form in
response to button clicks; both the Settings button and the Back button delegate screen
 
Search WWH ::




Custom Search