CPSC 233: Mini-Assignment #5
Due November 16 at 4 PM
New Concepts to be applied for the assignment
- Implementing a simple graphical user interface with common GUI controls
(JButton, JFrame)
and event handlers (ActionListener).
Overview
Everyone starts with a grade point of zero for this assignment. Implementing
each of the features below completely and correctly will award you
1.0 grade points (i.e. implementing all four features
will result in a grade point of 4.0 being awarded).
- When the program runs it will create a JFrame
containing a JButton the latter with some
default text (Figure 1): worth 1 letter step
- When the button is pressed two things will happen:
- The text of the button changes to a non-default value (Figure 2):
worth 1 letter step
- Another JFrame window appears that
contains the same non-default text contained in the button (Figure 3):
worth 1 letter step
- The close behavior for both (no credit if
you change one but not the other) JFrames
(triggered when the close window control is clicked: Figure 4) is changed
from hiding the window to the disposal of the control: worth 1 letter
step
Figure 1: Program initially run,
JFrame
contains a JButton
with default text
Figure 2: Button pressed: the text of the
button changes to a non-default value
Figure 3: Button pressed: a new
JFrame
popup (containing the same non-default text from the button) appears for each
press
Figure 4:
Clicking on the close window control (top right of the
JFrame) will
'dispose' of the control (rather than default 'hide' behavior)
Submitting your work:
- Assignments (source code/'dot-java' file) must be electronically
submitted according to [the assignment submission requirements]
using [D2L].
Zip all your classes together into one zip file and upload the compressed
document. Do not use other file formats or your grade may be affected.
- As a reminder, you are not allowed to work in groups for this class.
Copying the work of another student will be
regarded as academic misconduct (cheating). For additional details about
what is and is not okay for this class please refer to the following
[link].
External libraries that can be used
Unlike the other assignments
you will make extensive use of the pre-created Java libraries developed by
Sun/Oracle for graphical components (e.g., java.awt.,
javax.swing), event handling (e.g.,
java.awt.event) .