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

displaying data in JTree...

Options
  • 02-03-2004 12:39pm
    #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