I am new to Java Swing and create GUIs using Netbeans. I want to do the following:
- Allow the user to click a button to set the working directory (complete)
- When the directory is set, use a Jtree to display the contents like which will contain subfolders with lots of text files within them (complete).
- When i click on any text file in the Jtree, I want to be able to display the contents of the text files in a large uneditable text area.
I can display the directories in the Jtree and see the files, but i do not know create the dynamic behavior i need to view the files when clicked in the tree. Open to suggestions on how implement this most efficiently. Grateful for any help!