All Packages Class Hierarchy This Package Previous Next Index
Class jclass.util.JCEnvironment
java.lang.Object
|
+----jclass.util.JCEnvironment
- public class JCEnvironment
- extends Object
Static routines to provide environment information.
-
BROWSER_APPLETVIEWER
-
-
BROWSER_EXPLORER
-
-
BROWSER_INTERPRETER
-
-
BROWSER_NETSCAPE
-
-
BROWSER_OTHER
-
-
BROWSER_UNKNOWN
-
-
OS_OTHER
-
-
OS_UNIX
-
-
JCEnvironment()
-
-
getApplet(Component)
- Follows the component's parents until
a parent applet is found.
-
getAppletContext(Applet)
- Gets the component's applet's context.
-
getBrowser(Component)
- Returns an int corresponding to the "java.vendor" System property:
BROWSER_UNKNOWN If the component's peer is null
BROWSER_APPLETVIEWER AppletViewer
BROWSER_EXPLORER MS Internet Explorer
BROWSER_INTERPRETER Running as a mainline
BROWSER_NETSCAPE Netscape Navigator
BROWSER_OTHER Other
-
getJavaVersion()
- Returns an int corresponding to the "java.version" System property:
JDK 1.0.2 102
JDK 1.1.0 110
-
getOS()
- Returns an int corresponding to the "os.name" System property:
OS_UNIX or OS_OTHER
-
inBrowser(Component)
- Returns true if the component is in an applet in a browser
(ie its AppletContext is not null).
OS_OTHER
public static final int OS_OTHER
OS_UNIX
public static final int OS_UNIX
BROWSER_UNKNOWN
public static final int BROWSER_UNKNOWN
BROWSER_OTHER
public static final int BROWSER_OTHER
BROWSER_INTERPRETER
public static final int BROWSER_INTERPRETER
BROWSER_APPLETVIEWER
public static final int BROWSER_APPLETVIEWER
BROWSER_NETSCAPE
public static final int BROWSER_NETSCAPE
BROWSER_EXPLORER
public static final int BROWSER_EXPLORER
JCEnvironment
public JCEnvironment()
getApplet
public static Applet getApplet(Component comp)
- Follows the component's parents until
a parent applet is found. Returns null if no applet is found.
getAppletContext
public static AppletContext getAppletContext(Applet applet)
- Gets the component's applet's context. The applet context
lets an applet control the applet's environment which is
usually the browser or the applet viewer.
- Returns:
- null if the component is not in an applet or the applet is not in
a browser.
- See Also:
- getAppletContext
inBrowser
public static boolean inBrowser(Component comp)
- Returns true if the component is in an applet in a browser
(ie its AppletContext is not null).
getOS
public static int getOS()
- Returns an int corresponding to the "os.name" System property:
OS_UNIX or OS_OTHER
getBrowser
public static synchronized int getBrowser(Component comp)
- Returns an int corresponding to the "java.vendor" System property:
BROWSER_UNKNOWN If the component's peer is null
BROWSER_APPLETVIEWER AppletViewer
BROWSER_EXPLORER MS Internet Explorer
BROWSER_INTERPRETER Running as a mainline
BROWSER_NETSCAPE Netscape Navigator
BROWSER_OTHER Other
- Parameters:
- comp - any component
getJavaVersion
public static int getJavaVersion()
- Returns an int corresponding to the "java.version" System property:
JDK 1.0.2 102
JDK 1.1.0 110
All Packages Class Hierarchy This Package Previous Next Index