Communication Between the Web Page and Java Applet
Applets can communicate with JavaScript code that runs in the Web Page. JavaScript code can call an applet Java methods and from the Java code you can invoke JavaScript code from the web page.
You are not limited to displaying only Swing dialog boxes from the applet. From the operations of an applet, you can invoke a JavaScript API that displays a web page and then obtains the data that has been filled in by the user.