SysInfo Applet

Download
© Comweb.nl , RJHM van den Bergh , sales@comweb.nl


File 1 of 1: SysInfo.java (Source code)
//
// SysInfo Used
// 
// DIsplays Information about the browser on an applet
//
//

import java.applet.*;
import java.awt.*;
import java.util.*;


public class SysInfo extends Applet
{
	public final String REVISION_DATE="October 06 2012";
	String[] key={"java.version","java.vendor","java.vendor.url","java.home",
	"java.class.version","java.class.path","os.name","os.arch","os.version",
	"file.separator","path.separator","line.separator","user.name","user.home",
	"user.dir"};
	public TextArea systemInfo;
	Hashtable<String,String> properties=new Hashtable<String,String>();

public void init()
{
	System.out.println("SysInfo Applet "+ REVISION_DATE);
	
	systemInfo=new TextArea();
	this.setLayout(new BorderLayout());
	this.add(systemInfo,BorderLayout.CENTER);
	
	for (int n=0;n<key.length;n++)
	{
		String value=null;
		try
		{
			value=System.getProperty(key[n]);
//		catch (com.ms.security.SecurityExceptionEx ee)
//		{
//			value="not accesible";		
//		}
		} catch (Exception e)
		{
			value="not accesible";		
		}
		systemInfo.append(key[n]+": "+value+"\n");	
		properties.put(key[n],value);	
	}
	
	if ( ((String)properties.get("java.vendor")).toLowerCase().startsWith("microsoft") )
	{
		try
		{		
			String build=com.ms.util.SystemVersionManager.getVMVersion().getProperty("BuildIncrement");
			systemInfo.append("Microsoft JVM build= "+build+"\n");
		} catch (Exception e) { /* not MS or security */ }
	}
	
	
}	

	
}


/*
java.version	Java version number
java.vendor	Java vendor-specific string
java.vendor.url	Java vendor URL
java.home	Java installation directory
java.class.version	Java class format version number
java.class.path	Java class path
os.name	Operating system name
os.arch	Operating system architecture
os.version	Operating system version
file.separator	File separator ("/" on UNIX)
path.separator	Path separator (":" on UNIX)
line.separator	Line separator ("\n" on UNIX)
user.name	User's account name
user.home	User's home directory
user.dir	User's current working directory
*/

/*
build=com.ms.util.SystemVersionManager.getVMVersion().getProperty("BuildIncrement");
*/