Java Reference
In-Depth Information
the AGUI limits the ability of applications to render on top of components. Because
components may be heavyweight, the JComponent paint methods ( paint , paintComponent ,
paintBorder , and paintComponents ) have been made final on the first concrete subclass of
JComponent . This is because the AGUI provides optimized, tight integration with the
underlying platform, and may use the platform's window toolkit to implement the AGUI.
Another way to look at this restriction is in light of the pluggable look and feel (PLAF)
provided by Swing and the AGUI; in Swing, it's easy for developers to override the presen-
tation of Swing components to provide their own look and feel. In the AGUI, this
functionality is primarily for platform vendors implementing the AGUI to be able to pro-
vide an optimal look and feel for the device, not for developers like you and me to create
a specific look and feel.
Wrapping Up
To remain compatible with the large number of applets on the Web and to provide a
familiar programming model, the PP provides support for the applet execution model.
Identical to the applet model in use in today's web browsers, the applet model that CDC
devices provide run applets in the context of an embedded web browser or another exe-
cution environment enforcing the same security model.
Applets have a life cycle similar to, but not the same as, MIDlets and Xlets.
Notably, there's no defined way to pause and restart an applet, and unlike both
MIDlets and Xlets, an applet cannot explicitly ask its containing application to termi-
nate the applet's execution. Because an applet is a subclass of java.awt.Container ,it
can contain other user-interface components or simply override its paint method and
draw its user interface directly.
To support applets, the PP also supports most of the AWT, which was Java's first user
interface hierarchy. While the AWT implementation is not complete—it lacks support for
printing, accessible interfaces, and some two-dimensional graphics—it has relatively few
limitations. Like the Java SE AWT, the PP-provided AWT is usually implemented using
heavyweight components, giving you the ability to create complex user interfaces that
reflect the look and feel of the native platform hosting the Java environment.
The AGUI, which is an optional package requiring the CDC, FP, and PBP, provides
yet another way for you to develop rich user interfaces on some devices. You can use
the AGUI to write not only applets, but Xlets as well. Based on the ubiquitous Swing
hierarchy of user-interface classes, the AGUI has a handful of limitations, such as limits
on top-level containers and how components can customize drawing behavior. The
AGUI also offers a more robust event framework, supporting both soft keys and hard-
ware buttons commonly found on today's consumer electronics devices.
 
Search WWH ::




Custom Search