Dear All,
Whenever i click on the applet button/menu item, a new window is opening. How to avoid this...
i.e. the button(help)
When i clcik on the "Help" button/menu an HTML file in a new browser window should open. Ok.
My Problem is....
If i click again on the button/menu-"Help" another new browser window is opening. i.e, 100 new windows for 100 clicks
1)I need only Only one window even if i click more on the menu or button.
2)If the window is already open it should popup for the next click on the menu or button item.
the code used.
public class getHelp extends Applet implements ActionListener {
String msg = " ";
Button help;
public void init() {
help = new Button("Help"
;
add(help);
help.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str = ae.getActionCommand();
if(str.equals("Help"
)
{
AppletContext ac = getAppletContext();
URL url = this.getCodeBase();
try{
ac.showDocument(new URL(url+ "SessionRecording.htm"
, "_blank"
;
}catch(MalformedURLException e)
{
showStatus("URl not found"
;
}
}
}
}
where i have to modify
Please get me a solution in java
Regards
NewComer
(thanks in advance)
Whenever i click on the applet button/menu item, a new window is opening. How to avoid this...
i.e. the button(help)
When i clcik on the "Help" button/menu an HTML file in a new browser window should open. Ok.
My Problem is....
If i click again on the button/menu-"Help" another new browser window is opening. i.e, 100 new windows for 100 clicks
1)I need only Only one window even if i click more on the menu or button.
2)If the window is already open it should popup for the next click on the menu or button item.
the code used.
public class getHelp extends Applet implements ActionListener {
String msg = " ";
Button help;
public void init() {
help = new Button("Help"
add(help);
help.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str = ae.getActionCommand();
if(str.equals("Help"
{
AppletContext ac = getAppletContext();
URL url = this.getCodeBase();
try{
ac.showDocument(new URL(url+ "SessionRecording.htm"
}catch(MalformedURLException e)
{
showStatus("URl not found"
}
}
}
}
where i have to modify
Please get me a solution in java
Regards
NewComer
(thanks in advance)