0

I have a controller which I want to save to disk. It contains a view I would also like to serialize. The lookAndFeel however is not serializable. The error I get when trying is:

java.io.NotSerializableException: com.sun.java.swing.plaf.windows.XPStyle

This makes sense, but how do I make it so the ObjectOutputStream ignores certain variables over which I have no control? I can accept an answer that "you just can't." But I'm hoping there is a way I can do this :) Thanks!

kentcdodds
  • 27,113
  • 32
  • 108
  • 187

1 Answers1

2

My solution was to put the transient keyword in front of any view in my controllers and have those reloaded when the object is reloaded. That's probably the way it should be anyway. Thank heaven for the layers of MVC.

kentcdodds
  • 27,113
  • 32
  • 108
  • 187