|
|
One potentially useful application of serialization is to be able to load applets directly from a file containing the applet in its serialized form. For this purpose, a new attribute of the <APPLET> tag was introduced: OBJECT. This is intended to be used in place of the CODE attribute: <applet width=415
height=150 object="SerializedApplet.ser"> This should cause the browser to create the applet by downloading the specified file (SerializedApplet.ser in the above example), and then deserializing it. The applet can be quite complex, with many GUI components; however, it cannot contain non-serializable classes unless serialization on those components is disabled. The GUI can have been initialized earlier before it was serialized out; once deserialized back in by the browser, the applet will resume its initialized state without further work. You don't even have to serialize your applet by programming it. You can use appletviewer. Here's what you do:
Unfortunately, I have never been able to get this to work in any current browser.
|
The page was last updated February 19, 2008 |