The course looks at the Swing API in two takes.
In the first take,
the students are introduced to the following ideas:
-
creating a new window using JFrame;
-
putting GUI components
such as JButtons and JTextFields into the pane of a window;
-
introducing an object to listen for the event
of a click of a button;
-
grouping components together using a Box
(in preference to a JPanel);
-
providing a form to allow multiple values to be input;
-
using a JDialog to force the user to complete the form.
In order to use the Swing API,
a programmer
is required to be familiar with the
idea of declaring a class that implements an interface.
In this course, the lectures on the Swing API
appears immediately after the lectures
that introduce interfaces and classes.
In later lectures, the classes JMenuBox,
JMenu and JMenuItem
are introduced.
These three classes are needed to build a menu system.
Because JMenuItems are another form of button,
responding to a click of a menu item
can be handled in a similar way to that for buttons
(which were discussed in earlier lectures).