FileTree version 1.0

September 23rd, 2007 Arash Posted in Open Source |

I was coding at work, and I needed a tree view of the file system so user’s could select a directory in a utlitiy I was writing. There’s nothing in the Java libraries that does that (as of JDK 1.6), so I figured this would be a cool little swing object to develop and make available for others. I finished it about a month ago, but I didn’t have time to thoroughly document it and make a page for it on my website until now.

I call it FileTree and it extends the Java JTree class. It has the native system icons next to all the files and directories for OS X and Windows. On Linux, because neither the File class or the FileSystemView class return specific icons, some generic icons are used for the folder and file nodes.

I hope this library comes in handy for any Java developers out there, and if you find any bugs, make any improvements or have any interesting feature requests, please let me know about them.

One Response to “FileTree version 1.0”

  1. This is really a nice bean you have done. I have been googling since sunday and i found several types but urs was outstanding with the “getSelectedFile()” method you added cos none of the ones i found were able to return the selected file. I want to drag the selected node to a JList and after that a joptionpane is shwn when it gets to the jlist, how can i do that?

Leave a Reply