Java Reference
In-Depth Information
CHAPTER 10
Introducing Applets and the
Advanced Graphics and User
Interface
H igh-end devices based on the CDC are, in many ways, very close in features to true
computers. Many have always-on access to the Internet or to other networks with gate-
ways to the Internet; some may even have built-in web browsers. To reflect these
capabilities, the PP defined in JSRs 62 and 216 defines support for applets and provides
backward compatibility with the Xlet application model you saw in the last chapter.
The applet model defined by the PP is identical to the classic applet model that's been
with Java since the beginning; PP devices can execute applets in either an embedded
web browser or in a native execution environment that provides the same facilities.
Moreover, the PP requires the presence of the Java AWT, making it easy to create com-
plex user interfaces.
In this chapter, I explain the applet execution model supported by devices that
provide the PP. I review the fundamentals of writing applets before discussing the user-
interface options available to you when writing Xlets and applets for PP-enabled devices.
In the process, I discuss both the AWT and Advanced Graphics and User Interface (AGUI)
implementations that you may encounter on devices that support the PP.
Writing Applets for Java ME
The original intent of the Java applet execution model was to provide an execution envi-
ronment for Java code downloaded over the Web within the confines of a web browser.
Dating back to the earliest days of Java, the applet adheres to strict security restrictions,
including the following:
• An applet cannot define or invoke native methods.
• An applet cannot access files on the host that executes the applet.
253
 
Search WWH ::




Custom Search