🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.java.gui
7 messages
7 total messages Started by janc2000 Fri, 17 Nov 2000 00:00
Spooky JTree problem
#35
Author: janc2000
Date: Fri, 17 Nov 2000 00:00
14 lines
975 bytes
Hi,

I've created a JFrame based window which contains a JTree object (I'm using
JBuilder 4).
To my big surpirse this JTree has a root node with 3 subnodes named
"colors", "sports" and "food",
although I have not added any code to populate the three.
I've done a scan of all my sources on this names and could not find any of
them.

Anybody knows what is going on?


Jan
Re: Spooky JTree problem
#36
Author: jet
Date: Fri, 17 Nov 2000 00:00
24 lines
1560 bytes
if you look at the source code for JTree you'll see why you're getting this;
this is what you get when you use the JTree empty constructor;
don't ask why they did it this way; maybe it was a demo thing
that never got cleaned up; maybe they left it in because somebody
thought it was cute; if they had to have something in there i don't
know why they just didn't put in a dummy root node but there
it is


janc2000@deja.com wrote:

> Hi,
>
> I've created a JFrame based window which contains a JTree object (I'm using
> JBuilder 4).
> To my big surpirse this JTree has a root node with 3 subnodes named
> "colors", "sports" and "food",
> although I have not added any code to populate the three.
> I've done a scan of all my sources on this names and could not find any of
> them.
>
> Anybody knows what is going on?
>
> Jan
Re: Spooky JTree problem
#37
Author: Raffael Herzog
Date: Fri, 17 Nov 2000 00:00
24 lines
1649 bytes
On Fri, 17 Nov 2000, janc2000@deja.com wrote:

> Hi,
> 
> I've created a JFrame based window which contains a JTree object
> (I'm using JBuilder 4).  To my big surpirse this JTree has a root
> node with 3 subnodes named "colors", "sports" and "food", although I
> have not added any code to populate the three.  I've done a scan of
> all my sources on this names and could not find any of them.
> 
> Anybody knows what is going on?

This is the default content of JTree. Usually, you give a new root
node to the constructor of the tree or set it later using
setRoot(). If you don't the JTree will have the content you
discribed. This is very practical when you draft GUIs because you
don't have to populate the tree to see that it is a tree.


-- 
Raffael Herzog
herzog@raffael.ch

May the penguin be with you!
Re: Spooky JTree problem
#38
Author: Guillaume Rousse
Date: Fri, 17 Nov 2000 00:00
18 lines
1605 bytes
jet a �crit :
> 
> if you look at the source code for JTree you'll see why you're getting this;
> this is what you get when you use the JTree empty constructor;
> don't ask why they did it this way; maybe it was a demo thing
> that never got cleaned up; maybe they left it in because somebody
> thought it was cute; if they had to have something in there i don't
> know why they just didn't put in a dummy root node but there
> it is

Maybe just because using a null node as root isn't allowed in current
implementation (UnallowedValueException thrown)...

-- 
Guillaume Rousse

Murphy's law : If anything can go wrong, it will.
O'Tool's commentary : Murphy was an optimist.
Re: Spooky JTree problem
#39
Author: janc2000
Date: Fri, 17 Nov 2000 00:00
9 lines
853 bytes
Jet, Guillaume and Raffael,

Thanks a lot for the fast reply.
I didn't knew that the java sources where shipped with the JDK.
Now everything is clear.

Thanks again,

Jan
R: Spooky JTree problem
#40
Author: Anteo
Date: Fri, 17 Nov 2000 00:00
24 lines
1380 bytes
Probably you use a Tree object that is already defined by JBuilder or you.

Anteo


<janc2000@deja.com> wrote in message
3a152ef5$0$20284$73bec57d@news.be.uu.net...
> Hi,
>
> I've created a JFrame based window which contains a JTree object (I'm
using
> JBuilder 4).
> To my big surpirse this JTree has a root node with 3 subnodes named
> "colors", "sports" and "food",
> although I have not added any code to populate the three.
> I've done a scan of all my sources on this names and could not find any of
> them.
>
> Anybody knows what is going on?
>
>
> Jan
>
>
Re: Spooky JTree problem
#42
Author: Nils O. Sel�sdal
Date: Thu, 23 Nov 2000 07:47
22 lines
1813 bytes
Its just for testing, trees in other languages/libraries have the same
feature
the'll go aaway when you add your own nodes..
<janc2000@deja.com> wrote in message
news:3a152ef5$0$20284$73bec57d@news.be.uu.net...
> Hi,
>
> I've created a JFrame based window which contains a JTree object (I'm
using
> JBuilder 4).
> To my big surpirse this JTree has a root node with 3 subnodes named
> "colors", "sports" and "food",
> although I have not added any code to populate the three.
> I've done a scan of all my sources on this names and could not find any of
> them.
>
> Anybody knows what is going on?
>
>
> Jan
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads