Re: JTree?
From: Knute Johnson (nospam_at_sagebrush.frazmtn.com)
Date: 01/29/04
- Next message: Robert Ludewig: "learning how to parse"
- Previous message: Jay Zimmerman: "Join Us for the 2004 No Fluff Just Stuff Java Symposium Tour"
- In reply to: Christophe Vanfleteren: "Re: JTree?"
- Next in thread: Jim Sculley: "Re: JTree?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Jan 2004 13:39:14 -0800
Christophe Vanfleteren wrote:
>>>Make classes Client, Project not non-static inner classes of TreeTest.
>>>
>>>That way you have a reference
>>>
>>>TreeModel -> TreeNode -> Client -> TreeTest -> JTree
>>>
>>>so you end up also serializating the JTree.
>>>
>>>I don't know exactly why the JTree doesn't de-serialize properly.
>>>
>>>
>>>
>>>Christian
>>
>>Christian:
>>
>>That fixed it. Thanks very much. I don't understand why having Client
>>and Project as inner classes should make a difference. I thought a
>>class was a class.
>>
>>Thanks again,
>>
> Yes and no: non static inner classes actually contain a (implicit) reference
> to their outer class (since you can't have an inner class without an
> instance of it's outer class).
> As Christian said, when you serialize a Client instance, you'll also
> serialise the entire TreeTest class. This doesn't happen when Client is a
> regular public class.
>
That makes sense. I did try making TreeTest Serializable but it didn't
work. I may try playing with it some more for fun.
Thanks,
-- Knute Johnson email s/nospam/knute/ Molon labe...
- Next message: Robert Ludewig: "learning how to parse"
- Previous message: Jay Zimmerman: "Join Us for the 2004 No Fluff Just Stuff Java Symposium Tour"
- In reply to: Christophe Vanfleteren: "Re: JTree?"
- Next in thread: Jim Sculley: "Re: JTree?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|