Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

want to avoid new Window for every menu item click

Status
Not open for further replies.

2br

Programmer
Apr 21, 2002
6
IN
Dear All,

Whenever i click on the applet menu item, a new window is opening each time.
i.e. the menu
Help
-About
When i clcik on the "About" menu an HTML file is opening. Ok. But if i click again on the menu-"About" another help window will open. i.e, 100 new windows for 100 clicks

I need only Only one window, and if the window is already opend it should popup for the next click on the menu item.

the code used.

where i have to modify

private URL helpURL=null;

public void showHelp(){
AppletContext f =this.getAppletContext() ;
String codebase=this.getCodeBase().toString();
try{
helpURL=new URL(codebase+"//help//dummy.htm");
f.showDocument(helpURL,"footer1");
}
catch(Exception e){
}
}



Please get me a solution in java

Regards
Bharat
 
simple!

create an instance of the frame at the start of the program and setVisible to false

under the action performed all u need to do is setvisible(true)

that way, only one instance of the frame is created
 
Hello nightwolf,

it is not working as if you told,
since the help window(HTML page)opening in a new window(browser), how can i get the status of the new window to the java program.

Next thing i want to know is that, for the second click the window should popup automatically(if the window is already open).

regards
Bharat
(thanks in advance)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top