Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This class extends javax.swing.JApplet , which extends java.applet.Applet, so it adds some capabilities to the regular Applet class.
From the same javax.swing package, we use JLabel, JTextField, JButton and JPanel .
The JApplet contains a JPanel, that we can use to add components to.
We CANNOT add components to JApplet itself !
We obtain its reference by calling JApplet's method getContentPane.
We set the layout mode of this JPanel .
And add the components to it.
Swing components, JComponent-s, can be transparent. Since we want the label to stand out, we make it opaque.
javax.swing.JButton has NOT been derived from java.awt.Button.
JButton is a
javax.swing.AbstractButton is a
javax.swing.JComponent is a
So, there you have it, JComponent extends the familiar awt Container class and is used as a base class for most visual swing classes.