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.

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 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

 Create a JFrame window

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

 Background color should change depending on which button was clicked and which color name was on that button

 I recommend a loop to NOT pick the same color for button 2 after button 1 color was chosen. The same for the remaining buttons.

 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 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.

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

  • 8 years ago
Assignment Completed
NOT RATED

Purchase the answer to view it

blurred-text
  • attachment
    lifiunit8ch18.zip