PPT Slide
// set up Canvas to draw on
myCanvas = new Canvas( );
// place components on screen
setLayout( new BorderLayout( ) );
add( printHello, "North" );
add( myCanvas, "Center" );
public void actionPerformed ( ActionEvent evt ) {
// print a simple message to see what button was pressed
// getSource( ) returns a reference to the object that
// caused the event to happen
if ( evt.getSource( ) = = other )
System.out.println( “other pressed.” );
System.out.println( “Print 'Hello World' pressed.” );