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

2. import java.applet.*; 

3. import java.awt.*; 

4. public class Params 

5.     extends JApplet 

6.

7.   JButton   bt ; 

8.  

9.   public Params (  ) 

10.   { 

11.     bt = new JButton ( "Original label" ) ; 

12.   } 

13.  

14.   public void init ( ) 

15.   { 

16.     String param = getParameter ( "BTTX" ) ; 

17.     if ( param != null

18.       bt.setLabel ( param ) ; 

19.  

20.     Container cp = getContentPane(); 

21.     cp.setLayout( new FlowLayout() ); 

22.     cp.add ( bt ) ; 

23.     cp.setBackground ( Color.cyan ) ; 

24.   } 

25.

26. =========== params.html =================== 

27. ...... 

28. <APPLET 

29.  CODE     = "Params.class" 

30.   WIDTH    = 300 

31.   HEIGHT   = 100 

32.

33.  

34. <PARAM NAME="BTTX" VALUE="StringfromHTML"

35.  

36. </APPLET

37.  

38. <HR

39.  

40. <APPLET 

41.  CODE     = "Params.class" 

42.   WIDTH    = 400 

43.   HEIGHT   = 100 

44.

45.  

46. <PARAM NAME="BTTX" VALUE="Button label from HTML"

47.  

48. <PARAM NAME="NOTUSED" VALUE="anti-gravity"

49.  

50. </APPLET

51. ........ 

52.