Question: 12. When the following Java program runs, two buttons will be displayed on a frame. What are the captions of the two buttons? What will

 12. When the following Java program runs, two buttons will be
displayed on a frame. What are the captions of the two buttons?

12. When the following Java program runs, two buttons will be displayed on a frame. What are the captions of the two buttons? What will happen when the first button is clicked? What will happen when the second button is clicked? import javax.swing.* import java.awt. import java.awt.event. /l Create two buttons private JButton jbtOk - new JButton"Democratic") private JButton jbtCancel- new JButton("Republic"); Default constructor / public TestActionEventO // Set the window title setTitle("TestActionEvent"); I/ Set FlowLayout manager to arrange the components I/ inside the frame setLayout(new FlowLayout0); Il Add buttons to the frame addGbtOk); add(jbtCancel); // Create a listener object ButtonListener btListener new ButtonListener0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!