Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JTree display "freeze" object values possible?

Reply
Thread Tools

JTree display "freeze" object values possible?

 
 
Sam
Guest
Posts: n/a
 
      06-17-2004
I have a JTree component in a GUI which displays the state of an
arbitrary object over time, i.e. as separate entries in the JTree for
each point in time I want to display. When you click on the object, it
uses java reflection to display the attributes of the class. What I
would like to do is "freeze" the object to display the attributes of
the object *at the time it was added to the JTree component*.
Otherwise, it will just show the current values for all entries in the
JTree.

Copying the object is not practical, since it is actually an object
tree and would entail some considerable work.

Is there anyway short of copying the object tree to handle this
requirement?

thanks,
Sam90
 
Reply With Quote
 
 
 
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      06-18-2004
Sam wrote:
> What I
> would like to do is "freeze" the object to display the attributes of
> the object *at the time it was added to the JTree component*.
> Otherwise, it will just show the current values for all entries in the
> JTree.
>
> Copying the object is not practical, since it is actually an object
> tree and would entail some considerable work.


You are asking for a miracle. Your situation is (t == time):

t0: Object contains data X
t1: Object was added to JTree
t2: Object's data is changed from X to Y. You refuse to store
the old X, so X is lost.
t3: You want Object(t1), but that state doesn't exist any more.

Either you remember the data, or you don't have it. It's that simple.

/Thomas

BTW: I hope you add the object to a TreeModel and not just to a JTree.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display an image in a JTree Aaron Fude Java 2 11-28-2009 03:02 AM
Convert array of values into jTree groupie Java 8 06-22-2008 03:21 PM
Display XML in JTree Rasikow Gnaniyar Java 1 03-12-2008 11:50 AM
JTree Selection lost when JTree looses focus jumpz Java 3 11-12-2007 03:55 PM
Display the jTree groupie Java 3 07-08-2007 01:37 AM



Advertisments