FileDocCategorySizeDatePackage
Buffering.javaAPI DocExample3368Tue Apr 11 13:05:48 BST 2000None

Buffering

public class Buffering extends Frame

Fields Summary
private NoBuffer
noB
private Buffered
buf
private Button
notBuffered
private Button
buffered
Constructors Summary
public Buffering()

  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 );
   
Methods Summary
public static voidmain(java.lang.String[] args)

  new Buffering();