SHARE
TWEET

Untitled

a guest Nov 15th, 2012 8 Never
  1. import java.awt.event.ActionEvent;
  2. import java.awt.event.ActionListener;
  3.  
  4. public class ClickListener_P12_3 implements ActionListener
  5. {  
  6.     public void actionPerformed(ActionEvent event)
  7.     {  
  8.         System.out.print(event.getActionCommand()+
  9.         " was clicked ");
  10.         System.out.print(clickCount);
  11.         System.out.print(" times.");
  12.         System.out.println();
  13.  
  14.         clickCount++;
  15.     }
  16.    
  17.     private int clickCount = 1;
  18. }
RAW Paste Data
Top