aspose file tools*
The moose likes Beginning Java and the fly likes How to Open html page in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to Open html page in java" Watch "How to Open html page in java" New topic
Author

How to Open html page in java

nandhini sruthi
Greenhorn

Joined: Jan 11, 2008
Posts: 17
Hi,
I need help for how to open html page in new window while click the button in java.please give the solution.

Thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41870
    
  63
What does "clicking a button in java" mean? Is this a desktop application? An applet? Something else?

Should the web page be displayed in a browser or in the Java GUI?


Ping & DNS - my free Android networking tools app
nandhini sruthi
Greenhorn

Joined: Jan 11, 2008
Posts: 17
Hi,

I done some design in html page.In applet while click the button the html page should display in new window.That is in Either browser or Java GUI.

Thanks in advance.
Nathan Leniz
Ranch Hand

Joined: Nov 26, 2006
Posts: 132
Opening a new window in a browser is as simple as using some of the additional options in the <a href... block.

W3C tutorial


The very existence of flamethrowers proves that at some time, some where, some place, someone once said to themselves "I'd really like to set those people on fire over there, but I just can't get close enough".
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41870
    
  63
It's rather difficult to display a web page in a Java GUI, so let's stay with displaying it in the browser.

In the applet class you can call the "getAppletContext().showDocument(...)" method. If you pass it just a single parameter, the page will replace the current page (which contains the applet). If you want to display the page in a new window, you need to use the showDocument call that takes two parameters.
 
Don't get me started about those stupid light bulbs.
 
subject: How to Open html page in java