September 2005
Beginner
576 pages
13h 6m
English
You establish a class as the subclass of another class with the extends statement, as in the following:
class AnimatedLogo extends javax.swing.JApplet {
// behavior and attributes go here
}
The extends statement establishes the AnimatedLogo class of objects as a subclass of JApplet, using the full class name of javax.swing.JApplet. As you will see during Hour 17, “Creating Interactive Web Programs,” all Swing applets must be subclasses of JApplet. They need the functionality this class provides to run when presented on a web page.
One method that AnimatedLogo will have to override is the paint() method, which is used to draw all things that are shown on the program's window. The paint() method is implemented by the ...
Read now
Unlock full access