PPT Slide
// If button was pressed, process it; otherwise, let method
// action in the superclass process it
public boolean action(Event e, Object arg) {
if (arg.equals(buttons[0])) {
// Handle press of "New game" and return true
System.out.println("\"new game\" pressed");
if (arg.equals(buttons[1])) {
// Handle press of "Quit" and return true
System.out.println("\"Quit\" pressed");
System.out.println("TextField is: \"" +
textf.getText( ) + "\"");
System.out.println("selection is: \"" +
textf.getSelectedText( ) + "\"");
return super.action(e,arg);
(class Experiment to be continued)