This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 15th, 2012  |  syntax: None  |  size: 0.46 KB  |  views: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data