tags:

views:

248

answers:

1

I would like to open a new window at Google.com, but then later close that window. My current code is as follows:

link="http://www.google.com"

try
{
    AppletContext a = getAppletContext();
    URL url = new URL(link);
    a.showDocument(url,"_blank");
}
catch (MalformedURLException e)
{
    System.out.println( e.getMessage() );
}

This opens the window, but how do I close it later?

+1  A: 

I'd suggest using the JSObject interface to call into the browser for opening the windows. Then you can get the variable of the new window and use that to close it.

More documentation:

jsight