public final class WebBrowser
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
browse(java.lang.String url)
Attempts to use the system default browser to visit
url . |
static void |
main(java.lang.String[] args) |
static boolean |
useBrowserForUrl(java.lang.String url)
Test whether or not a given URL should be opened in a web browser.
|
public static void browse(java.lang.String url)
url
. Tries
looking for and executing any browser specified by the IDV property
"idv.browser.path".
If the property wasn't given or there was an error, try the new (as of Java 1.6) way of opening a browser.
If the previous attempts failed (or we're in 1.5), we finally try some more primitive measures.
Note: if you are trying to use this method with a
JTextPane
you may need to turn off editing via
JTextComponent.setEditable(boolean)
.
url
- URL to visit.tryUserSpecifiedBrowser(String)
,
openNewStyle(String)
,
openOldStyle(String)
public static boolean useBrowserForUrl(java.lang.String url)
url
- URL to test. Cannot be null
.true
if url
begins with either
"http:" or "https:".public static void main(java.lang.String[] args)