Question To be answered in (13) Minutes / 2.5 Marks GUI Example Green Yellow Red Display Light: Green A user can control

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Question To be answered in (13) Minutes / 2.5 Marks GUI Example Green Yellow Red Display Light: Green A user can control

Post by answerhappygod »

Question To Be Answered In 13 Minutes 2 5 Marks Gui Example Green Yellow Red Display Light Green A User Can Control 1
Question To Be Answered In 13 Minutes 2 5 Marks Gui Example Green Yellow Red Display Light Green A User Can Control 1 (26.7 KiB) Viewed 28 times
Question To Be Answered In 13 Minutes 2 5 Marks Gui Example Green Yellow Red Display Light Green A User Can Control 2
Question To Be Answered In 13 Minutes 2 5 Marks Gui Example Green Yellow Red Display Light Green A User Can Control 2 (26.7 KiB) Viewed 28 times
Question To Be Answered In 13 Minutes 2 5 Marks Gui Example Green Yellow Red Display Light Green A User Can Control 3
Question To Be Answered In 13 Minutes 2 5 Marks Gui Example Green Yellow Red Display Light Green A User Can Control 3 (32.38 KiB) Viewed 28 times
Question To be answered in (13) Minutes / 2.5 Marks GUI Example Green Yellow Red Display Light: Green A user can control the Display light in the application by pressing on the buttons at the top of the main iframe (using FlowLayout). When a button is pressed, the label activeLight' on the right of the label "Display Light" (both labels are inside a panel that uses Flowlayout) changes according to the corresponding light. The default text of activeLight is "Green". Complete the following code skeleton (next page) to reproduce the same interface and interaction using Java Swing/Awt libraries and event handling components. Upload your java file or compress and upload it.

import javax.swing. import java.awt.event.": import java.awt.: public class Graphic Test public static void main(String args) { // fill in code here 7 i Complete the missing parts in Tlight class for GUI // Class declaration part (0.5 pt) class Change Light // you must correct the class declaration // Components declaration and instantiation JPanel lights - new JPanelo: JPanel display = new JPanelo: JLabel disLabel - new JLabel("Display Light:"); JLabel activeLight-new JLabel("Green"); JButton green=new JButton("Green"); JButton yellow = new JButton("Yellow"): JButton red - new JButton("Red"); public Changel.ight i/fill in the missing code under here. Iall components and panels have been I/declared previously. // set other properties of JFrame setVisible(true): setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE): setSize(300, 150): setTitle("GUI Example"): 1 @Override public void action Performed(ActionEvent ae) { // complete handling the events and setting the text of the activel.ight label to // the corresponding light
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply