Unit 7 Chapter 17 Assignment
Grading Information: This Program is due on Date Specified.
Comments are REQUIRED; flow charts and pseudocode are NOT REQUIRED.
Directions Points
The files must be called <LiFiUnit7Ch17.java>
The files must be called as specified above, (LiFi = Your Last Initial Your First Initial)
Proper coding conventions required the first letter of the class start with a capital
letter and the first letter of each additional word start with a capital letter.
Only submit the .java files needed to make the program run. Do not submit the
.class files or any other files.
5%
Style Components
Include properly formatted prologue, comments, indenting, and other style elements
as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892.
5%
Topics covered in chapter
Topics with * are covered in this assignment.
Event-Driver Programming Basics
*JFrame Class
*Java Components
*JLabel Components
JTextField Components
*Component Listeners
*Inner Classes
*JButton Components
*Dialog Boxes and JOptionPane Class
Distinguising Between Multiple Events
Using getActionCommand to Distringuish Between Multiple Events
*Color
How GUID Classes Are Group Together
Mouse Listener and Images (Optional)
Basic Requirements
Write a program that that displays a dialog box show a message and a randomly
chosen color.
This random color is to be used as the background color of a JFrame window which
should appear after “OK” is selected. The window should ask your name and thank
you for playing once “Enter” is pressed.
See sample output below.
LiFiUnit7Ch17.java
Utilize showMessageDialog to output the message shown in the sample at the
bottom. A random color should be output with each run
Upon clicking OK
Create a JFrame window
o Set the background and label text color as shown in sample below
o Include a label asking to enter name (see sample)
o Include a textfield to get input for name (see sample)
o Upon hitting “Enter” on the keyboard, output thank you message to
include the name entered as per sample at bottom
Use an inner class for the listener
Mimic the same session precisely. Pay attention to colors of the window and
label.
90%
NOTE: Complete your activity and submit it by clicking “Submit Assignment”
Total Percentage 100%
Sample
Your output will vary based on the random color generated.
Initial dialog box
Green window with Blue for label color
Red window with White for label color
White(ish) window with Black for label color
Blue window with White for label color
Yellow window with Black for label color
Resulting window after name “Ken” entered and “Enter” pressed on the keyboard
Color of window and text should match original window/label color
Unit 8 Chapter 18 Assignment
Grading Information: This Program is due on Date Specified.
Comments are REQUIRED; flow charts and pseudocode ar ...
Unit 7 Chapter 17 Assignment Grading Information This Pro.docx
1. Unit 7 Chapter 17 Assignment
Grading Information: This Program is due on Date Specified.
Comments are REQUIRED; flow charts and pseudocode are
NOT REQUIRED.
Directions Points
The files must be called <LiFiUnit7Ch17.java>
The files must be called as specified above, (LiFi = Your Last
Initial Your First Initial)
Proper coding conventions required the first letter of the class
start with a capital
letter and the first letter of each additional word start with a
capital letter.
Only submit the .java files needed to make the program run. Do
not submit the
.class files or any other files.
5%
Style Components
Include properly formatted prologue, comments, indenting, and
other style elements
as shown in Chapter 2 starting page 64 and Appendix 5 page
881-892.
2. 5%
Topics covered in chapter
Topics with * are covered in this assignment.
Event-Driver Programming Basics
*JFrame Class
*Java Components
*JLabel Components
JTextField Components
*Component Listeners
*Inner Classes
*JButton Components
*Dialog Boxes and JOptionPane Class
Distinguising Between Multiple Events
Using getActionCommand to Distringuish Between Multiple
Events
*Color
How GUID Classes Are Group Together
Mouse Listener and Images (Optional)
Basic Requirements
Write a program that that displays a dialog box show a message
and a randomly
chosen color.
This random color is to be used as the background color of a
JFrame window which
3. should appear after “OK” is selected. The window should ask
your name and thank
you for playing once “Enter” is pressed.
See sample output below.
LiFiUnit7Ch17.java
the sample at the
bottom. A random color should be output with each run
o Set the background and label text color as shown in sample
below
o Include a label asking to enter name (see sample)
o Include a textfield to get input for name (see sample)
o Upon hitting “Enter” on the keyboard, output thank you
message to
include the name entered as per sample at bottom
the window and
4. label.
90%
NOTE: Complete your activity and submit it by clicking
“Submit Assignment”
Total Percentage 100%
Sample
Your output will vary based on the random color generated.
Initial dialog box
Green window with Blue for label color
Red window with White for label color
White(ish) window with Black for label color
Blue window with White for label color
5. Yellow window with Black for label color
Resulting window after name “Ken” entered and “Enter”
pressed on the keyboard
Color of window and text should match original window/label
color
Unit 8 Chapter 18 Assignment
Grading Information: This Program is due on Date Specified.
Comments are REQUIRED; flow charts and pseudocode are
NOT REQUIRED.
Directions Points
The files must be called <LiFiUnit8Ch18.java>
The files must be called as specified above, (LiFi = Your Last
Initial Your First Initial)
Proper coding conventions required the first letter of the class
start with a capital
letter and the first letter of each additional word start with a
capital letter.
6. Only submit the .java files needed to make the program run. Do
not submit the
.class files or any other files.
5%
Style Components
Include properly formatted prologue, comments, indenting, and
other style elements
as shown in Chapter 2 starting page 64 and Appendix 5 page
881-892.
5%
Topics covered in chapter
Topics with * are covered in this assignment.
*GUI Design and Layout Mangers
*FlowLayout manger
BoxLayout manager
GridLayout Manager
*JPanel Class
JTextArea Component
JCheckBox Component
JRadionButton Component
JComboBox Component
Basic Requirements
Write a program that that displays a JFrame window with 5
buttons. The buttons will
7. be used to control the background color.
The button’s text will be randomly chosen from 5 colors and the
background color will
change to the color shown on the button.
See sample output below.
LiFiUnit8Ch18.java
o Display 5 buttons showing 1 color each in a random order
from the
choices: Red, Blue, Yellow, Green, White
o Ensure no color name is duplicated
was clicked and
which color name was on that button
ame color for button 2
after button 1
color was chosen. The same for the remaining buttons.
8. the window and
label.
90%
NOTE: Complete your activity and submit it by clicking
“Submit Assignment”
Total Percentage 100%
Sample
Your output will vary based on the random colors order.
Initial window before any color is selected
Random Colors listed on each button. Background color
changes to paticular button when clicked.
Red was clicked.
Random Colors listed on each button. Background color
changes to paticular button when clicked.
Green was clicked.
9. Random Colors listed on each button. Background color
changes to paticular button when clicked.
Blue was clicked.
Other colors and button orders function the same way.