/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1. public class JLAp 

2.     extends java.applet.Applet 

3.     implements java.awt.event.MouseListener 

4.

5. int count = 0

6.  

7. public JLAp () 

8.

9.   addMouseListener ( this ) ; 

10.  

11.   setBackground ( java.awt.Color.pink ) ; 

12.

13.  

14. public void paint ( java.awt.Graphics   gr ) 

15.

16.   gr.drawString ( 

17.     "Counter is now " + count , 

18.       75, 30  ); 

19.

20.  

21. public void mouseClicked ( java.awt.event.MouseEvent ev  ) 

22.

23.   count++; 

24.   repaint (); 

25.

26.  

27. public void mousePressed ( java.awt.event.MouseEvent ev ) 

28.  { } 

29. public void mouseReleased ( java.awt.event.MouseEvent ev ) 

30.  { } 

31. public void mouseEntered ( java.awt.event.MouseEvent ev ) 

32.  { } 

33. public void mouseExited ( java.awt.event.MouseEvent ev ) 

34.  { } 

35.