Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #850
| From | "Corona4456" <corona4456@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: JTree node icon |
| Message-ID | <1170263683.026956.183800@l53g2000cwa.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <1170258620.349437.274560@l53g2000cwa.googlegroups.com> |
| Date | 2011-04-27 15:29 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui On Jan 31, 8:50 am, "Edwin Dankert" <edank...@gmail.com> wrote: > > Sometimes for some nodes icons must be changed to 32*16. > > The problem is: when "large" icon is assigned to node its text becomes > > "cropped" because cell size doesn't increased. > > I just realised that you could have meant that the 'nodes icons must > be changed' when the node is already displayed ... in which case I > would suggest the following. > > Normally the tree updates its nodes (adjusting height, width and other > stuff) when the model fires a change event for the specific node. > > So, your solution would involve firing this change event ... > > For more information, please have a look at: > DefaultTreeModel.html#nodeChanged(javax.swing.tree.TreeNode) [http:// > tinyurl.com/gm9er] > > Regards, > Edwin > --http://www.edankert.com/ To add to that... you would then call JTree.updateUI(). This will cause the JTree to 'requery' each cell for it's height and width. --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Find similar
Re: JTree node icon "Edwin Dankert" <edwin.dankert@THRWHITE.remove-dii-this> - 2011-04-27 15:29 +0000 Re: JTree node icon "Corona4456" <corona4456@THRWHITE.remove-dii-this> - 2011-04-27 15:29 +0000
csiph-web