Inheritance and GUIs

To create JFrames that do what we want, we create a new class that inherits from the JFrame.

Take a look at the inheritance hierarchy of the javax.swing.JFrame class in the standard runtime API documentation. This hierarchy indicates that JFrame is a Frame and Frame is a Window and Window is a Container and Container is a Component and finally Component is an Object (just like all the other classes are in Java since the Object class is the root class from which they all descend). A more general way to look at this is to say a child class can be used any place any of its ancestor classes can be used. This means that JFrame is a Frame and a Window and a Container and a Component and an Object.