dcsimg
Problems serializing a JTree
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   wilu_wilu
Posted On:   Wednesday, April 18, 2001 01:02 PM

When I save the tree the first time only part of my GUI seems to change, gets corrupted, but if i perform the operation the second time it totally corrupts the UI. This erorr is thrown after the writeObject() routine is performed but it only happens when my code is done and the main thread executes classes I can't debug: java.lang.NullPointerException at javax.swing.plaf.basic.BasicMenuBarUI.uninstallListeners(BasicMenuBarUI.java:145) at javax.swing.plaf.basic.BasicMenuBarUI.uninstallUI(BasicMenuBarUI.java:132) at javax.swing.JComponent.compWriteObjectNotify(JComponent.java:4532) at javax.swing.JComponent$EnableSerializationFocusListener.writeObject(JComponent.java:4522) at java.lang.refle   More>>

When I save the tree the first time only part of my GUI seems to change, gets corrupted, but
if i perform the operation the second time it totally corrupts the UI.
This erorr is thrown after the writeObject() routine is performed but it only happens when my code is done and the main thread executes classes I
can't debug:

java.lang.NullPointerException
at javax.swing.plaf.basic.BasicMenuBarUI.uninstallListeners(BasicMenuBarUI.java:145)
at javax.swing.plaf.basic.BasicMenuBarUI.uninstallUI(BasicMenuBarUI.java:132)
at javax.swing.JComponent.compWriteObjectNotify(JComponent.java:4532)
at javax.swing.JComponent$EnableSerializationFocusListener.writeObject(JComponent.java:4522)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.awt.AWTEventMulticaster.save(AWTEventMulticaster.java:763)
at java.awt.Component.writeObject(Component.java:4507)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:1098)
at java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOutputStream.java:456)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at java.awt.Container.writeObject(Container.java:1766)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:1098)
at java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOutputStream.java:456)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at java.awt.Container.writeObject(Container.java:1766)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:1098)
at java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOutputStream.java:456)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at java.awt.Container.writeObject(Container.java:1766)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:1098)
at java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOutputStream.java:456)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
at javax.swing.tree.DefaultMutableTreeNode.writeObject(DefaultMutableTreeNode.java:1272)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:1098)
at java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOutputStream.java:456)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at javax.swing.tree.DefaultMutableTreeNode.writeObject(DefaultMutableTreeNode.java:1263)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:1098)
at java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOutputStream.java:456)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at javax.swing.tree.DefaultMutableTreeNode.writeObject(DefaultMutableTreeNode.java:1263)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at javax.swing.tree.DefaultTreeModel.writeObject(DefaultTreeModel.java:540)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:1098)
at java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOutputStream.java:456)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at javax.swing.JTree.writeObject(JTree.java:2351)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1878)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at SIMBrowser.save(SIMBrowser.java:1559)
at SIMBrowser.saveItemActionPerformed(SIMBrowser.java:761)
at SIMBrowser.access$1(SIMBrowser.java:756)
at SIMBrowser$2.actionPerformed(SIMBrowser.java:161)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
at javax.swing.AbstractButton.doClick(AbstractButton.java:279)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:886)
at java.awt.Component.processMouseEvent(Component.java:3717)
at java.awt.Component.processEvent(Component.java:3546)
at java.awt.Container.processEvent(Container.java:1164)
at java.awt.Component.dispatchEventImpl(Component.java:2595)
at java.awt.Container.dispatchEventImpl(Container.java:1213)
at java.awt.Component.dispatchEvent(Component.java:2499)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
at java.awt.Container.dispatchEventImpl(Container.java:1200)
at java.awt.Window.dispatchEventImpl(Window.java:912)
at java.awt.Component.dispatchEvent(Component.java:2499)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)

   <<Less
About | Sitemap | Contact