/* 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.event.* ; 

2. import java.awt.* ; 

3. import java.applet.*; 

4.  

5. public class Buttonup 

6.     extends Applet 

7.     implements ActionListener    

8.

9.   Button butt ;    

10.  

11.   public void actionPerformed ( ActionEvent ev )    

12.   { 

13.     setBackground ( Color.cyan ) ; 

14.     butt.setLabel ( "Ouch, not that hard !" ) ; 

15.   } 

16.  

17.   public Buttonup () 

18.   { 

19.     butt = new Button ( "Press me, if you please" ) ;  

20.   } 

21.  

22.   public void init() 

23.   { 

24.     butt.addActionListener ( this ) ;    

25.     setBackground ( Color.pink ) ; 

26.  

27.     add ( butt ) ;   

28.     validate () ; 

29.   } 

30.