Java Reference
In-Depth Information
public void startXlet() throws XletStateChangeException {
scene.setVisible(true);
}
public void pauseXlet() {
}
public void destroyXlet(boolean b) throws XletStateChangeException {
scene.dispose();
}
public void paint(Graphics g) {
g.drawString("Some text", 0, 100);
}
}
Fundamentally, the code in Listing 9-3 looks very much the same as the code in
Listing 9-2. The HAVi toolkit defines the notion of scenes , which you can think of as
being analogous to containers; the initXlet method creates a new scene and positions
it on the display. Otherwise, the code is the same as the previous example, except that
you must explicitly dispose of a scene when you're through with it; this Xlet does this as
part of the destroyXlet method.
Clearly, then, when setting out to develop Xlet applications, you should have answers
to the following questions before you begin your design:
• What version of the CDC is supported?
• What version of the FP is supported?
• What version of the PBP—or the PP—is supported?
• Which additional window toolkits, if any, are available?
In Chapter 10, after a brief discussion of applet development for the PP's support for
the Applet model, I discuss programming for the AWT and AGUI in more depth.
Developing Lightweight User Interfaces
Using the PBP
In the Java SE AWT, the entire AWT hierarchy descends from the Component class and its
subclass Container , and the class hierarchy acts as a proxy for a native UI component; for
example, the java.awt.Checkbox class is just a proxy for a corresponding peer component
that wraps the behavior of the native platform's window toolkit. On some PBP-enabled
 
Search WWH ::




Custom Search