The call to the superclass constructor must be the first statement in the MyFrame
constructor.
MyFrame
is a Container
,
because it inherits from JFrame
, so
GUI components can
be added to it.
When a component is added to a container,
a reference to the component
is added to the list of components in the container.
Graphically, the components added to a container appear within
the rectangle on the monitor allocated to the container.
In the example program,
the JLabel
is added to the frame,
and so appears within that area.
Could additional JLabel
references be added to MyFrame
?