Swipe to navigate through the chapters of this book
Though an applet must have a GUI, its containing class does not extend JFrame. This is hardly surprising, of course, since applets pre-date the Swing classes, but the applet’s containing class does not extend class Frame either. Before the Swing classes appeared, an applet consisted of a class that extended class Applet (from package java.applet). The introduction of the Swing classes brought in class JApplet (package javax.swing), which extends class Applet and makes use of the other Swing classes. Thus, later applets should extend class JApplet. Unfortunately, there are major differences of operation between applets that use only pre-Swing classes and those that use the Swing classes. ‘Differences in operation’ is actually putting it very mildly. A lot of Swing applets will simply not work in some of the earlier versions of Internet Explorer and Netscape! However, this problem has been eradicated in the latest versions of the major browsers, as will be seen in the next section. Since the Swing classes have been around for so long now, most of what follows will refer to Swing applets only, and the term ‘applets’ will be used without qualification. In 12.4.1, two pre-Swing examples are used, but these are identified as such explicitly.
Please log in to get access to this content
To get access to this content you need the following product:
- Springer London
- Sequence number
- Chapter number
- Chapter 12