Panel canvasP = new Panel();
canvasP.setLayout( new GridLayout( 1, 2 ) );
canvasP.add( noB );
canvasP.add( buf );
add( canvasP );
Panel buttonP = new Panel();
buttonP.setLayout( new GridLayout( 1, 2 ) );
buttonP.add( notBuffered );
buttonP.add( buffered );
add( buttonP, BorderLayout.SOUTH );
notBuffered.addActionListener( new ActionListener() {
public void actionPerformed( ActionEvent e )
{ noB.update();
}
});
buffered.addActionListener( new ActionListener() {
public void actionPerformed( ActionEvent e )
{ buf.update();
}
});
addWindowListener( new WindowAdapter() {
public void windowClosing( WindowEvent e )
{ System.exit(0);
}
});
pack();
setVisible( true );