I am at my wit's end in trying to find away to know if a user has clicked on the first child of a JTree. My tree has directories from A to Z. Inside
those dorectories are other directories. I want to be able to disable the popup menu items if the user clicks on a dir from A to Z. I could just use the String class to find this out except
sometimes there is a directory inside one of the leter directories that can start with just a single capital letter. I think it should be easier just to the find the child directories of the ROOT.
I cannot cast a node to Default MutableTreenode because I am suing the JTree provide by TrueZip classes for file encryption. I have tried playing with the following lines of code for an hour or so:
Edit: Actually you don't need to find the children of the root. What you need (I think) is simply to ask whether the parent of the selected directory is the root of the tree.
I previously had that idea too, but was not able to find the way to do this either. I want to be able to detect this so I can disable the rename command in the menu item so the user cannot rename the directories from A to Z. So it's back to the drawing board.