Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.InstantiationException / XMLEncoder error what's that?

807588Feb 10 2009 — edited Feb 11 2009
Hello there!

After I received so much help from Joachim yesterday, I think I have to bother you again with a problem:

I wrote this application for testing purposes. This app only counts an interger up and down from 0 to 10 and displays the value in a JTextBox as Strings like int = 3 means: "three". These Strings are all in an array. Additionally, I have implemented a localisation (german and english language). I read these properties from a .properties File and change the label of the buttons and the language of the value-strings. Also I serialize my app using the Beans-persistence.

So far so good but I get an error in the following situation:

When I change the language using a JMenuBar-entry and then close the app-window (now the app status is written to a xml-file (persistence)) I get:
java.lang.InstantiationException: javax.swing.PopupFactory$HeavyWeightPopup$1
Continuing ...
java.lang.Exception: XMLEncoder: discarding statement XMLTest.addWindowListener(PopupFactory$HeavyWeightPopup$1);
Continuing ...
The status is saved to the file and the reconstruction from the file works fine. But this error annoys me and I have to get rid of it. More information: when I run the app and foolin' around with the buttons BUT DON'T CHANGE the language, the error doesn't appear.

The app is working fine, but what does this error mean? I'm pretty new to Java and google doesn't help me...

Here is my code: http://pastebin.com/m6b58751c

Thanks for having a look...

Thomas

Edited by: king-al on Feb 10, 2009 11:57 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2009
Added on Feb 10 2009
14 comments
1,420 views