public class BrowserLauncher extends Object
Since JClic uses Java 1.6, this class can make direct calls to java.awt.Desktop.browse
Modifier and Type | Field and Description |
---|---|
static String |
BROWSER
Added by fbusquets - Key used to store browser settings in properties files *
|
Constructor and Description |
---|
BrowserLauncher() |
Modifier and Type | Method and Description |
---|---|
static String |
getPreferredBrowser(String defaultValue)
Added by fbusquets Gets the path to the user's preferred browser.
|
static void |
openURL(String surl)
Open a string URL
This is equal to
openURL(surl, null) so any error dialog
will have no parent. |
static void |
openURL(String surl,
Component parent)
Open a string URL
|
static void |
openURL(URL url)
Open a URL
This is equal to
openURL(url, null) so any error dialog will
have no parent. |
static void |
openURL(URL url,
Component parent)
Open a URL
|
static void |
setPreferredBrowser(String browserCmd)
Added by fbusquets Sets the path to the user's perferred browser.
|
public static final String BROWSER
public static void openURL(URL url, Component parent)
url
- URL
to openparent
- parent component for error message dialogpublic static void openURL(String surl, Component parent)
surl
- URL to open (as String)parent
- parent component for error message dialogpublic static void openURL(URL url)
This is equal to openURL(url, null)
so any error dialog will
have no parent.
url
- URL
to openpublic static void openURL(String surl)
This is equal to openURL(surl, null)
so any error dialog
will have no parent.
surl
- URL to open (as String)public static void setPreferredBrowser(String browserCmd)
browserCmd
- The path to the browser to be used by BrowserLaunchedpublic static String getPreferredBrowser(String defaultValue)
defaultValue
- The default choice, used only if preferred browser not set.Copyright © 2004-15 Francesc Busquets (fbusquets@xtec.cat) & Departament d'Educació de la Generalitat de Catalunya (info@xtec.cat)
Licensed under the terms of the GNU General Public License.