Creating an Applet User Interface |
[Introduce system properties. Refer to tools/system lesson on properties.]Applets can read some, but not all system properties. This page lists the system properties that Netscape Navigator 2.0 and the Applet Viewer allow applets to read, followed by a list of properties that applets can't read.
System Properties that Applets Can Read
Applets can read the following system properties:To read a system property from within an applet, the applet uses the System class methodKey Meaning ------------------- ------------------------------ "java.version" Java version number "java.vendor" Java vendor-specific string "java.vendor.url" Java vendor URL "java.class.version" Java class version number "os.name" Operating system name "os.arch" Operating system architecture "file.separator" File separator (e.g., "/") "path.separator" Path separator (e.g., ":") "line.separator" Line separatorgetProperty()
. For example:String s = System.getProperty("os.name");Forbidden System Properties
Applets can not read the following system properties.Key Meaning ------------------- ------------------------------ "java.home" Java installation directory "java.class.path" Java classpath "user.name" User account name "user.home" User home directory "user.dir" User's current working directory
Creating an Applet User Interface