开发者

Java Applets and DHTML: Can I keep an Applet alive while its <div> is gone?

I'm trying to integrate a Java Applet into a primarily JS web application w开发者_如何转开发ith lots of Dynamic HTML (using Ext.js in this case). I'd like to be able to use the applet inside a tabpanel (or equivalent layout), but when the DHTML yanks the div that the applet lives in upon switching to a new tab, the applet understandably exits. Then when switching back again, it is relaunched, thus losing any state it might have had.

Is there any good way to either keep the div around but hidden, or otherwise keep the applet alive within a DHTML heavy framework? I can also reduce the applet size to 0x0 and put it in a span if this is of any help, but it does need to be buried inside the JS framework to be managed properly.

Thanks/O


It is probably a better strategy to serialize the data in the applet destroy() method and reload it in the init() method.

For ways to serialize the data, see the 3 strategies outlined in How to save some config information in an Java Applet?.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜