Reputation: 1455
I have applets in my projects. When I want to display applet I load that applet using the applet tag in jsp page and load that page in div tag. it work fine. but when more applets loaded in same browser window then this window is slow down and sometime freezes and applets also becomes unresponsive . when i close the applet the loading div tag still in webpage.
is there any way to communicate betwwen applet and javascript. so that when applet close we are able to remove particular div or set to empty in which applet loaded.
When more applets loaded I check with top command java uses more memory and cpu also.
is there any way to minimise it or communicate between applet and javascript.
Thanks
Upvotes: 1
Views: 1037
Reputation: 33396
To communicate with applets, all you need to do is mark methods as as public
and call them like so:
<applet code="com.something.MyApplet"
mayscript="true" name="myApplet" width="200" height="100">
Assuming a doSomething
method, call it like so from your web page:
myApplet.doSomething("Hello");
As far as the web-page crashing, that's harder to debug, try different embedding methods in different browsers. Try to avoid serving more than one or two applets. Try to figure out if an applet in particular is causing a proble.
Upvotes: 1