Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Applets and the fly likes Applet Opening new html window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet Opening new html window" Watch "Applet Opening new html window" New topic

Applet Opening new html window

Denny Ong

Joined: Jan 15, 2004
Posts: 1
Hi, how can I open a new browser window from clicking a button in the applet?
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
If you want to keep your applet running and launch the URL in a new browser window, you can use this:
appletContext.showDocument(new URL(destURL), "_blank");
where appletContext is your AppletContext

My Java Freeware:<br />MACCC - <a href="" target="_blank" rel="nofollow"></a><br />Nator - <a href="" target="_blank" rel="nofollow"></a>
David Vickers

Joined: Oct 02, 2003
Posts: 13
Hi, I do the above, and it works fine, but is there a way to monitor when the new page is closed, and also can it be set to not have buttons, status etc, like a frame.
I know you can use,y,etc,etc) to set this up as a javascript call, but can it been done from an applet. alternative, can the 'window' remove the buttons, as it can resize with window.resizeTo(x,y).
I agree. Here's the link:
subject: Applet Opening new html window
It's not a secret anymore!