I'm calling the Java method Desktop.open() to open a URL in a browser window. Now I want to be able to close this window after some task is done. Calling window.close() JavaScript only works if I originally opened the window using the window.open() JavaScript function.

My question is, is there a way I can launch a browser window from Java and programmatically close it from either a) the JavaScript from the launched page or, b) the launching Java program? Any help is appreciated thanks.

0 Answers