13.9. Serializing Windows

Java 1.1 introduced an extremely useful capability: serialization. This capability lets you save the state of Java objects to disk or to send them over the network. In particular, with a single command (writeObject), you can save the state of a frame or other window, including all subwindows, sizes, locations, colors, and GUI controls. The only restriction is that any objects the window references must be serializable if you want them to be saved with the window. All AWT components are already serializable, and making other objects serializable is a trivial matter of having the class implement the Serializable interface. This interface does not declare any methods, so you can implement it by simply tacking “implements ...

Get Core Web Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.