M
Mickey Segal
As the "pure Java" way of launching new browser windows, the showDocument
method, is rendered nonfunctional in more and more environments by popup
blockers, developers whose Java applets are digitally-signed have been able
to get the same functionality by using Runtime.exec calls.
On the Macintosh one can open a new Firefox window regardless of the
location of Firefox as follows:
Runtime.getRuntime().exec(new String[] {"open", "-a", "Firefox.app",
url.toString()});
On Windows it is possible to launch Internet Explorer or Firefox by assuming
a particular location as follows:
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet
Explorer\\IEXPLORE.EXE\" " + url);
Runtime.getRuntime().exec("\"C:\\Program Files\\Mozilla
Firefox\\firefox.exe\" \"" + url + "\"");
The problem is that these forms depend on the browser files being in their
usual locations. Is there a way of launching the browsers in a
location-independent way using Java code on Windows, by analogy to what
works on the Macintosh even if Firefox is not in its usual location in the
/Applications folder?
NOTE: We use new browser windows to display further information on outside
Web sites such as articles about a diagnosis being considered by the user.
Using a new browser window allows us to do so without destroying our applet
or trying to shoehorn someone else's Web page into a frame on the same page
as our applet.
method, is rendered nonfunctional in more and more environments by popup
blockers, developers whose Java applets are digitally-signed have been able
to get the same functionality by using Runtime.exec calls.
On the Macintosh one can open a new Firefox window regardless of the
location of Firefox as follows:
Runtime.getRuntime().exec(new String[] {"open", "-a", "Firefox.app",
url.toString()});
On Windows it is possible to launch Internet Explorer or Firefox by assuming
a particular location as follows:
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet
Explorer\\IEXPLORE.EXE\" " + url);
Runtime.getRuntime().exec("\"C:\\Program Files\\Mozilla
Firefox\\firefox.exe\" \"" + url + "\"");
The problem is that these forms depend on the browser files being in their
usual locations. Is there a way of launching the browsers in a
location-independent way using Java code on Windows, by analogy to what
works on the Macintosh even if Firefox is not in its usual location in the
/Applications folder?
NOTE: We use new browser windows to display further information on outside
Web sites such as articles about a diagnosis being considered by the user.
Using a new browser window allows us to do so without destroying our applet
or trying to shoehorn someone else's Web page into a frame on the same page
as our applet.