Class BrowserControl
A simple, static class to display a URL in the system browser.
Under Unix systems, it will open one of the browser set through the
setBrowserCommand(String). The argument of this method
must be a fully qualified command or one of the commands returned
by getSupportedBrowsers().
By default, the browser is Firefox,
which is included in the list of supported browsers.
Under Windows, this will bring up the default browser under windows,
usually either Netscape or Microsoft IE. The default browser is
determined by the OS so no config is necessary.
This has been tested under Windows 95/98/NT/XP.
Notice that you must include the url type -- either "http://" or "file://".
Under Mac, the usability of this class is pending of test. So probably it does not work
Examples: BrowserControl.displayURL("http://www.javaworld.com") BrowserControl.displayURL("file://c:\\docs\\index.html") BrowserContorl.displayURL("file:///user/joe/index.html");- Author:
- jaume dominguez faus - jaume.dominguez@iver.es
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisplayURL(String url) Display a file in the system browser.static ArrayListReturns a list of supported browsers.static booleanTry to determine whether this application is running under Windows or some other platform by examing the "os.name" property.static voidsetBrowserCommand(String browserCommand)
-
Field Details
-
OPERA
- See Also:
-
NETSCAPE
- See Also:
-
MOZILLA
- See Also:
-
GALEON
- See Also:
-
EPIPHANY
- See Also:
-
FIREFOX
- See Also:
-
KONQUEROR
- See Also:
-
-
Constructor Details
-
BrowserControl
public BrowserControl()
-
-
Method Details
-
displayURL
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
-
setBrowserCommand
-
getSupportedBrowsers
Returns a list of supported browsers.- Returns:
-