Hi,

I tried the code, and indeed it freezes the application. The problem is probably that the UI thread is blocked by the web browser and the modal dialog cannot function properly. Such callbacks are supposed to run code but should not have any UI actions. They probably also have limitation with the methods they can call on the web browser while processing the function.

I think you should open the dialog asynchronously in a "SwingUtilities.invokeLater" call, and once the dialog closes, you execute Javascript code to notify the user's selection. It is not as simple as just returning the result to the caller, but it should solve the problem.

Please let me know if that answer is satisfying.
-Christopher