I have some long-running Java code running in a thread started by a Java applet. As soon as the code has finished, it has information for the user. I’d like to pass this information to a JavaScript callback in a thread-safe way. Just using the Java DOM API to modify the HTML document is not good enough, unless my JavaScript callback gets called as a side effect in a thread safe way (i.e. eventually, in the same browser thread where JavaScript callbacks execute). How can I implement this? Are there libraries already doing it?
Share
It seems that there is no public tutorial how to do it. The whole JavaScript–Java interface is underdocumented, and it is subject to browser limitations.