Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2304

Re: JTree forcing node to

From "bcd" <bcd@THRWHITE.remove-dii-this>
Subject Re: JTree forcing node to
Message-ID <fagvnp$c2b$2@orkan.itea.ntnu.no> (permalink)
Newsgroups comp.lang.java.gui
References <1187739706.626536.157780@x40g2000prg.googlegroups.com>
Date 2011-04-27 15:38 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
In article <1187739706.626536.157780@x40g2000prg.googlegroups.com>,
lionelv@gmail.com <lionelv@gmail.com> wrote:
>I've got a JTree and I've extended AbstractTreeNode creating 3
>different types of nodes. One of my subclasses is a Directory node. In
>JTree when a node has children it automatically sets the icon of that
>node to look something like a folder. However, if the node doesn't
>have children then it looks like a leaf node.
>
>Is there a simple solution to force a node to have the directory icon?

Override TreeModel.isLeaf() to return false for all your directory
nodes.

Cheers
	Bent D
-- 
Bent Dalager - bcd@pvv.org - http://www.pvv.org/~bcd
                                    powered by emacs

---
 * 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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

JTree forcing node to hav lionelv@gmail.com.remove-dii-this - 2011-04-27 15:38 +0000
  Re: JTree forcing node to "Dennis Groenendijk" <dennis.groenendijk@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
    Re: JTree forcing node to "Brandon McCombs" <brandon.mccombs@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
      Re: JTree forcing node to "Dennis Groenendijk" <dennis.groenendijk@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
        Re: JTree forcing node to "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
          Open source licenses Was: "Dennis Groenendijk" <dennis.groenendijk@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
  Re: JTree forcing node to lionelv@gmail.com.remove-dii-this - 2011-04-27 15:38 +0000
  Re: JTree forcing node to "bcd" <bcd@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
  Re: JTree forcing node to "Rogan Dawes" <rogan.dawes@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000

csiph-web