Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writeObject (JPanel) ignores listeners?

Status
Not open for further replies.

GDameron

Programmer
Aug 8, 2003
39
US
Using JDK 1.4. New to Java.

I have a Swing app consisting of a JFrame containing a JPanel containing a couple of JButtons ("Save" and "Restore") and a JTextField. When "Save" is selected, the app does a writeObject of the JPanel to a file. When "Restore" is selected, the app does a readObject from the file, replaces the current JPanel, then repaints. The "Restore" works _visually_ (all the components show up), but the JButton action listeners no longer fire when the Buttons are pushed. I am theorizing that writeObject excludes listener info. Can anyone confirm?

If so, is there a good way to save and restore the listener info?
 
If so I think you should mark lisetners as transient.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top