Link to home
Start Free TrialLog in
Avatar of my_moon011000
my_moon011000

asked on

open a new browser window with applet

How to create and open a new browser window with an applet?? Is there any method to do this in Java or must it go together with Java Script? Also, if it is possible to open a new window - how to send it HTML code? Please explain how it works with applet calling Java Script - if it is only solution !!
Avatar of heyhey_
heyhey_

getAppletContext().showDocument(url);

- Interface java.applet.AppletContext -

 public abstract void showDocument(URL url)

Replaces the Web page currently being viewed with the given URL. This method may be ignored by applet contexts that are not browsers.

Parameters:

url - an absolute URL giving the location of the document.


 public abstract void showDocument(URL url,                                   String target)

Requests that the browser or applet viewer show the Web page indicated by the url argument. The target argument indicates in which HTML frame the document is to be displayed. The target argument is interpreted as follows:


"_self"       Show in the window and frame that contain the applet.
"_parent"      Show in the applet's parent frame. If the applet's frame has no parent frame, acts the same as "_self".
"_top"       Show in the top-level frame of the applet's window. If the applet's frame is the top-level frame, acts the same as "_self".
"_blank"       Show in a new, unnamed top-level window.
name      Show in the frame or window named name. If a target named name does not already exist, a new top-level window with the specified name is created, and the document is shown there.
An applet viewer or browser is free to ignore showDocument.

Parameters:

url - an absolute URL giving the location of the document.
target - a String indicating where to display the page.
ASKER CERTIFIED SOLUTION
Avatar of snataraj
snataraj

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of my_moon011000

ASKER

Thanks, I needed some code !
dear my moon,
              Thanks for the acceptance.

all the best
sankar