Question: In Java: I have the GO! button but now I am trying to make a WAIT! and STOP! button too... can someone show me the

In Java: I have the "GO!" button but now I am trying to make a "WAIT!" and "STOP!" button too... can someone show me the code on how I make the 2 buttons??

This is what I have:

import java.awt.*; import javax.swing.*;

class ButtonFrame extends JFrame { JButton bChange ; // reference to the button object

// constructor for ButtonFrame ButtonFrame(String title) { super( title ); // invoke the JFrame constructor setLayout( new FlowLayout() ); // set the layout manager

bChange = new JButton("GO!"); // construct a JButton add( bChange ); // add the button to the JFrame setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); } }

public class ButtonDemo { public static void main ( String[] args ) { ButtonFrame frm = new ButtonFrame("Button Demo");

frm.setSize( 150, 75 ); frm.setVisible( true ); } }

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!