Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

JTree, NodeIcons are not shown

Thread view: 
Janko Dimitroff - 26 Jan 2004 20:25 GMT
Hi everyone,

I have a problem with JTree. I dynamically insert TreeNodes. Sometimes when I expand a node for the first time, there are no icons for the subnodes and leafs.
when i collapse end re-expand, then the icons are there but the horizontal size of the Label is not wide enough to fully write the nodes name.

So instand of
[ICON] Nodes name

there is:
[ICON] Nodes n...

The width for the label is obviously computed before the first time to show, without considering the icons width. When I after that collapse and expand the width is not wide enough for the icon AND the label.

This points to some mistake on inserting nodes or treating the tree the right way.

Has anyone experienced this problem and found out to avoid it ?

thanks for help in advance

janko
Michael Rauscher - 28 Jan 2004 16:33 GMT
Hi Janko,

Janko Dimitroff schrieb:
> Hi everyone,
>
[quoted text clipped - 16 lines]
>
> janko

After you've inserted some nodes into your TreeModel, you have to notify
the TreeModelListeners about these changes. JTree registers itself as
TreeModelListener at the TreeModel. All you have to do is to fire a
TreeModelEvent.

Bye
Michael


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.