Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java (Microwave.java) (MicrowaveTesting.java) Exercise 1: (2 points) Java Project: _LABO6_Microwave Objective: To learn how to create simple containers: JFrame and JPanel, and create Components and

java

image text in transcribed

(Microwave.java)

image text in transcribed

(MicrowaveTesting.java)

image text in transcribed

Exercise 1: (2 points) Java Project: _LABO6_Microwave Objective: To learn how to create simple containers: JFrame and JPanel, and create Components and put them in the Container Suggestion: Ir To explain your TA, student SHOULD define a variable name as the following format: _ For example, JButton button_Stop = new JButton("Stop"); Instruction: Download Microwave.java from Google Classroom and complete a class Microwave to create a user interface for a Microwave oven. Write a class MicrowaveComponents to show Microwave GUI 550 JFrame The Front View of a Microwave Oven Microwave Time Display Border Layout 1 2 3 5 Border Layout TextField GridLayout JButton(s) Food to be placed here JButton 9 Stop o Start . Students SHOULD consider details of the GUI design, and arrange a sequence before adding components This JFrame of Microwave" contains the first panel panal01_MicrowaveLayout that has its layout on two sides: CENTER and EAST. The CENTER part contains the button button_Foods for placing foods, and defines "Food to be placed here" This ControlPanel composes of 12 equal size buttons that are represented by fourrows and three The EAST part contains the second panel panal02_Number Layout" that composes of 12 equal size buttons represented by four rows and three as below: 1. The NORTH part contains a textfield"textfield_TimeDisplay" to display microwave's time, and defines "Microwave Time Display" 2. The CENTER part contains the matrix layout (3x3) to display buttons by 1,2,3,4,5, 6,7,8,9, respectively. *Students MUST use a FOR loop to add those buttons 3. The CENTER part also contains three remaining buttons to display "Stop", "0", and "Start", respectively. Microwave.java x Users > pauruetai > Downloads > O Microwave.java > 1 Eimport java.awt.*; 2 port javax.swing.*; 3 4 public class Microwave extends JFrame { 5 public Microwave() { 6 //Call the method: MicrowaveComponents 7 8 9 //Set JFrame 10 } 11 12 13 public void MicrowaveComponents() { //Create the first panel of MicrowaveLayout to position its components 14 15 16 17 // Add the first panel into the EAST of MicrowaveLayout 18 19 20 //Create a button to place foods at the CENTER of MicrowaveLayout 21 22 23 //Create the second panel and set GridLayout for adding the button's numbers 24 25 26 27 //At the first panel, Create a textfield to display its time at the NORTH of MicrowaveLayout 28 29 30 //Use a FOR loop to add the button's numbers into the NumberLayout 31 32 1/Create three button (Stop, 0, Start) and add them into the second JPanel 33 34 35 36 1/Add the second JPanel to the first panel at the CENTER of MicrowaveLayout 37 38 39 } 40 } Microwave.java Microwave Testing.java X 1 Users > pauruetai > Downloads > O MicrowaveTesting.java > Po MicrowaveTesting public class MicrowaveTesting { Run Debug public static void main(String[] args) { Microwave myMicrowave = new Microwave(); 4 } } ou + W N Exercise 1: (2 points) Java Project: _LABO6_Microwave Objective: To learn how to create simple containers: JFrame and JPanel, and create Components and put them in the Container Suggestion: Ir To explain your TA, student SHOULD define a variable name as the following format: _ For example, JButton button_Stop = new JButton("Stop"); Instruction: Download Microwave.java from Google Classroom and complete a class Microwave to create a user interface for a Microwave oven. Write a class MicrowaveComponents to show Microwave GUI 550 JFrame The Front View of a Microwave Oven Microwave Time Display Border Layout 1 2 3 5 Border Layout TextField GridLayout JButton(s) Food to be placed here JButton 9 Stop o Start . Students SHOULD consider details of the GUI design, and arrange a sequence before adding components This JFrame of Microwave" contains the first panel panal01_MicrowaveLayout that has its layout on two sides: CENTER and EAST. The CENTER part contains the button button_Foods for placing foods, and defines "Food to be placed here" This ControlPanel composes of 12 equal size buttons that are represented by fourrows and three The EAST part contains the second panel panal02_Number Layout" that composes of 12 equal size buttons represented by four rows and three as below: 1. The NORTH part contains a textfield"textfield_TimeDisplay" to display microwave's time, and defines "Microwave Time Display" 2. The CENTER part contains the matrix layout (3x3) to display buttons by 1,2,3,4,5, 6,7,8,9, respectively. *Students MUST use a FOR loop to add those buttons 3. The CENTER part also contains three remaining buttons to display "Stop", "0", and "Start", respectively. Microwave.java x Users > pauruetai > Downloads > O Microwave.java > 1 Eimport java.awt.*; 2 port javax.swing.*; 3 4 public class Microwave extends JFrame { 5 public Microwave() { 6 //Call the method: MicrowaveComponents 7 8 9 //Set JFrame 10 } 11 12 13 public void MicrowaveComponents() { //Create the first panel of MicrowaveLayout to position its components 14 15 16 17 // Add the first panel into the EAST of MicrowaveLayout 18 19 20 //Create a button to place foods at the CENTER of MicrowaveLayout 21 22 23 //Create the second panel and set GridLayout for adding the button's numbers 24 25 26 27 //At the first panel, Create a textfield to display its time at the NORTH of MicrowaveLayout 28 29 30 //Use a FOR loop to add the button's numbers into the NumberLayout 31 32 1/Create three button (Stop, 0, Start) and add them into the second JPanel 33 34 35 36 1/Add the second JPanel to the first panel at the CENTER of MicrowaveLayout 37 38 39 } 40 } Microwave.java Microwave Testing.java X 1 Users > pauruetai > Downloads > O MicrowaveTesting.java > Po MicrowaveTesting public class MicrowaveTesting { Run Debug public static void main(String[] args) { Microwave myMicrowave = new Microwave(); 4 } } ou + W N

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started