WindowAdapter needs to be defined,The program has been expanded with more blanks for you to fill code that does those three things.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class TwoButtons extends JFrame implements ActionListener
{
JButton redButton ;
JButton grnButton ;
// constructor for TwoButtons
public TwoButtons()
{
redButton = new JButton("Red");
grnButton = new JButton("Green");
getContentPane().setLayout( new FlowLayout() );
getContentPane().add( redButton );
getContentPane().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 );
}
}