It's been a while. Nobody has any ideas?
> Hi guys I recently found this code (and modified it to be in a window
> so you can simply compile and run it for your convenience) in one of
[quoted text clipped - 103 lines]
> false;}
> }
> Hi guys I recently found this code (and modified it to be in a window
> so you can simply compile and run it for your convenience) in one of
[quoted text clipped - 9 lines]
> rid of these icons on the directories that don't contain sub
> directories before the user clicks on it? Thanks!
This is the normal behaviour of a JTree - it does not query unopened
nodes about whether it has any children before it is actually opened.
I had written a workaround years back - will try to locate it and post
it if I can find it. If not, the general idea of that workaround was to
listen to a nodeExpanded(?) event, and perform an expand and collapse
of all new nodes that just became visible programmatically. Once a node
has been opened, the JTree will remember that state afterwards.
BK
Jason - 29 Sep 2006 21:58 GMT
> > Hi guys I recently found this code (and modified it to be in a window
> > so you can simply compile and run it for your convenience) in one of
[quoted text clipped - 20 lines]
>
> BK
Sorry about my delay on getting back to you. Yes, I see your logic on
going about that, and I may try it out. I hesitate, however, because
when this method would check the computer's floppy drives, it will
create a long pause for each drive. I guess what I might do is use this
only on drives other than the floppies. Would you know of a way to
check to see if a certain root is a floppy drive? I'm also thinking
about customizing the root drive node's icons by having it display its
drive type icon. For instance, nodes that represent floppy drives will
be displayed with a floppy drive icon, hard drives with a hard drive
icon, etc. I know how to customize specific node's icons, but I don't
know how to check to see what type of drive the root node is
representing. I would also use this check to skip the time consuming
task of checking each floppy drive for subdirectories. Any ideas?
Babu Kalakrishnan - 01 Oct 2006 09:54 GMT
>>>Does anyone know how I can check the currently expanding node and get
>>>rid of these icons on the directories that don't contain sub
[quoted text clipped - 16 lines]
> representing. I would also use this check to skip the time consuming
> task of checking each floppy drive for subdirectories. Any ideas?
Check out the API docs of the javax.swing.filechooser.FileSystemView class.
BK
Jason - 05 Oct 2006 19:19 GMT
> >>>Does anyone know how I can check the currently expanding node and get
> >>>rid of these icons on the directories that don't contain sub
[quoted text clipped - 20 lines]
>
> BK
Wow I've never heard of the FileSystemView class before, and it does
look like some of these methods can help me. It looks like I'm good for
now - thanks!