I've done something similar. I pass data from an
Applet to a servlet, the servlet searches the database, the results are sent back and displayed in another browser instance. Basically, the applet opens the new browser using the URL of the servlet...
postData = //URL encrypted post data
URL searchURL = new URL (servletBase,"servlet/SearchServlet?"+postData);
URLConnection conn = searchURL.openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type","text/html");
//Open another browser window and show the servlet results
appletContext.showDocument(conn.getURL(),"_blank");
I know this isn't exactly what you were looking for, but it might help.
Good luck.