Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

displaying data in JTree...

  • 02-03-2004 11:39am
    #1
    Posts: 0


    Hey all,

    In Java, I want to display the contents of directories on a drive (Windows), like Windows Explorer.

    My method to populate the tree works nicely, however, the problem is when it comes across a folder with nothing inside, but is still a folder, it is displayed in the tree as a leaf node, which doesn't have the normal folder symbol.

    I could just have all leaf nodes look the same but I don't wish to do this approach, if there is another way that anyone can think of, that would be great.

    Thanks!


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    You can use java.util.Files isDirectory() to determine if something is a directory regardless of the number of children it has. You should use this when determining your CellRenderers.


Advertisement