tig
Class BrowserControl
- java.lang.Object
-
- tig.BrowserControl
-
public class BrowserControl extends java.lang.ObjectA simple, static class to display a URL in the system browser.By Steven Spencer, found at http://www.javaworld.com/javaworld/javatips/f_jw-javatip66.html.
- Under Unix, the system browser is hard-coded to be 'netscape'. Netscape must be in your PATH for this to work. This has been tested with the following platforms: AIX, HP-UX and Solaris.
- Under Windows, this will bring up the default browser, usually either Netscape or Microsoft IE. The default browser is determined by the OS. This has been tested under Windows 95/98/NT.
Examples :BrowserControl.displayURL("http://www.javaworld.com")BrowserControl.displayURL("file://c:\\docs\\index.html")BrowserContorl.displayURL("file:///user/joe/index.html");
Note - you must include the url type -- either "http://" or "file://".
-
-
Constructor Summary
Constructors Constructor and Description BrowserControl()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voiddisplayURL(java.lang.String url)Display a file in the system browser.static booleanisWindowsPlatform()Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.static voidmain(java.lang.String[] args)Simple example for standalone use.
-
-
-
Method Detail
-
displayURL
public static void displayURL(java.lang.String url)
Display a file in the system browser. If you want to display a file, you must include the absolute path name.- Parameters:
url- the file's url (the url must start with either "http://" or "file://").
-
isWindowsPlatform
public static boolean isWindowsPlatform()
Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.- Returns:
- true if this application is running under a Windows OS
-
main
public static void main(java.lang.String[] args)
Simple example for standalone use.
-
-
DMelt 3.0 © DataMelt by jWork.ORG