Working with Applets

Let's start off with an interactive session. Import Applet from the java.applet package.

>>> from java.applet import Applet
>>> applet = Applet()

An applet is a panel (java.awt.Panel), and, as we learned earlier, a panel is also a component.

>>> applet.class.superclass
<jclass java.awt.Panel at -731859681>

So, if an applet is a panel, and a panel is a component, an applet is also a component (and thus a component container). That means that everything you've learned about components and panels applies to applets as well.

Surveying the Applet Landscape

Applet inherits all of class java.applet.Applet's functionality. What's more, the Applet class employs the Façade design pattern, which facilitates the use of many utilities ...

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.