/* 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. import java.awt.*; 

2. import java.awt.event.*; 

3. import java.applet.*; 

4.  

5. public class SEMMAp 

6.     extends Applet 

7.     implements ActionListener 

8.

9.   int  cnt = 0

10.  

11.   Button   bt  = null

12.   Label  lb  = null

13.  

14.   public void 

15.   actionPerformed ( ActionEvent ev ) 

16.   { 

17.     cnt++ ; 

18.  

19.     lb.setText( "Count : " + cnt  ); 

20.   } 

21.  

22.   public SEMMAp ( ) 

23.   { 

24.     bt = new Button ( "Press me" ) ; 

25.     lb = new Label ( "Nothing yet" ) ; 

26.   } 

27.  

28.   public void init ( ) 

29.   { 

30.     add ( bt ) ; 

31.     add ( lb ) ; 

32.     lb.setBackground( Color.yellow ); 

33.     bt.addActionListener ( this ); 

34.   } 

35.

36.