/* 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 Settings 

6.     extends Applet 

7.     implements ActionListener 

8.

9.   Button btn ; 

10.   TextArea ta ; 

11.    

12.   public void 

13.   actionPerformed ( ActionEvent ev ) 

14.   { 

15.     ta.setText ( "" ) ; 

16.     String tx ; 

17.      

18.     tx = System.getProperty ( "java.version" ) ;    

19.      

20.     ta.append ( "java.version\t: " + tx + "\n" ) ; 

21.      

22.     tx = System.getProperty ( "os.name" ) ;       

23.  

24.     ta.append ( "os.name\t: " + tx + "\n" ) ; 

25.  

26.     tx = System.getProperty ( "os.version" ) ; 

27.  

28.     ta.append ( "os.version\t: " + tx + "\n" ) ; 

29.  

30.     tx = System.getProperty ( "java.vendor" ) ; 

31.  

32.     System.out.println ( "In the Java console, java.vendor :" + tx ) ; 

33.  

34.     showStatus ( "====> Applets only, not for important messages <===" ) ; 

35.   } 

36.  

37.   public Settings (  ) 

38.   { 

39.     btn = new Button ( "Get them" ) ; 

40.     ta = new TextArea ( 5, 40 ) ; 

41.   } 

42.  

43.   public void init() { 

44.     btn.addActionListener ( this ); 

45.     add ( btn ) ; 

46.     add ( ta ) ; 

47.     setBackground ( Color.green ); 

48.     validate (); 

49.   } 

50.

51. /*============== 

52.  System.setProperty( "somekey", "somevalue" ); 

53.  System.getProperties().list( System.out ); 

54.  String s = System.getProperty("akey", "UNKNOWN"); 

55. */