import java.awt.*;
import java.awt.event.*;
public class TwoButtons extends Frame implements ActionListener
{
Button redButton = new Button("Red");
Button grnButton = new Button("Green");
TwoButtons() // constructor for TwoButtons
{
setLayout( new FlowLayout() ); // choose the layout manager
add( redButton );
add( grnButton );
}
. . . . more code will go here . . . .
public static void main ( String[] args )
{
TwoButtons demo = new TwoButtons() ;
_______________wquit = new _______________(); // 2
demo._______________( wquit ); // 3
demo.setSize( 200, 150 );
demo.setVisible( true );
}
}
class ______________ extends ______________ // 1
{
public void windowClosing( WindowEvent e )
{
System.______________( 0 ); // what to do for this event--exit the program
}
}
|