• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

Opening a page in a Java applet

Paul C. Anagnostopoulos

Nap, interrupted.
Joined
Aug 3, 2001
Messages
19,141
Java applet experts,

I asked this question awhile ago, but perhaps new information has come to light.

Is there any platform-independent way of opening up a new browser page from a Java applet? Considering the context of a Java applet, you'd think it would be trivial, yet I cannot figure out a way to do it. I want to be able to present help information on the applet by opening a page directed to an external site when the user pokes a Help button.

Any help, so to speak, would be appreciated.

~~ Paul
 
Maybe I'm misunderstanding you, but wouldn't it be easier to just have a link to the help page in the actual web page (in which your applet is embedded)?

If you don't want the link to be displayed all the time, you could alter the web page from the applet using the DOM (see JSObject).
 
In other words, you want the help page to open in a new window?

Why not just use target="_blank" or Javascript to pop up a new window? Here's an article that describes how to achieve that (I'm just a couple of posts away from being able to post real links ;): devarticles.com/c/a/Web-Design-Usability/Building-Friendly-Popup-Windows/
 
The problem is that I can't find a platform-independent method of opening a page at all. Remember that I'm writing a Java applet, which has restrictions on what it can do (for example, it can't write a local file).

I'll look into BrowserLaunch2.

~~ Paul
 
This might work.

I was thinking about your question and I came up with an idea involving a kludge way of doing it involving a hidden field and setTimeout function to call itself and check the value in the browser which would have been modified by the applet. But then I came accross this code, it looks like it might be able to do what you want.


http://www.rgagnon.com/javadetails/java-0172.html
 

Back
Top Bottom