Restricting the addition of nodes of a JTree except for the 1st level child
问题 I have been trying a lot of approaches on how to limit my code on adding nodes only to the 1st level. This means that the user can only add nodes to the 1st level children of a JTree. Adding a node in my program can be done in 2 ways 1. Add node button 2. Select > Right click > Add node (In here, I wanted to disable this behavior if it a non 1st level child is selected. It's a long shot though ) I need a validation that permits the addition of nodes in other levels. Thanks! Here is the