Applets can communicate with JavaScript code which runs in the Web Page. JavaScript code can call an applet's Java methods and from the Java code you can invoke JavaScript code from the web page.
You are not limited to displaying only Swing dialogs from the applet. From an applet's operations you can invoke JavaScript API which shows a web page and then obtains the data which has been filled by the user.