Creating a Graphical User Interface in Java
In this lab, you create a graphical user interface in a partially completed Java program. The program should create two 3Buttons. Display the text Yes on one of the JButtons, and display the text No on the other J Button. You should also create three JLabels. Display the text Do you like GUI programming? Vote Yes or No. on one of the JLabels. Display the text Click here to vote Yes on another JLabel, and display the text Click here to vote No on the third ]Label. Also, add event handlers that cause the background color of the JPanel to change to yellow if a user votes yes and to red if a user votes no. Use the GuiDemo class discussed in this section as a guide.
1. Open the file named JavaQuiz. Java using Notepad or the text editor of your choice.
2. Create the three JLabel s named labelYes, labelNo, and labelQuestion with the text described above.
3. Create two Muttons named buttonYes and buttonNo with the text described above.
4. Create a JPanel named myPanel.
5. Save the file, JavaQuiz.Java, in a directory of your choke.
6. Compile the file JavaQuiz. java.
7. Execute the program.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.