Remaining code

The remaining code in the anonymous class definition is shown in Listing 6.

Listing 6. The remaining code.
        //Override the inherited
        // processMouseEvent method.
        public void processMouseEvent(
                                   MouseEvent e){
          if (e.getID() ==
                       MouseEvent.MOUSE_CLICKED){
            System.out.println(
                              "buttonB clicked");
          }//end if
          //Required of overridden
          // processMouseEvent method.
          super.processMouseEvent(e);
        }//end processMouseEvent
      }//end class definition
    );//end add method call
File: cq.htm [Next] [Prev]