I have a JTree looking something like this:
Student Group
Group 1
Student 1
Student 2
...
Student n
Group 2
Student 1
Student 2
Student 3
...
Student m
Is there any way to achieve following:
1) Add a new Student Group (let's say, Group 3) without selecting parent node Student Groups?
2) Add a new Student (let's say, Student m+1) in Group 2 without selecting parent node Group 2?
My plan was to achieve this by clicking on a proper menu item (New -> Student Group, New -> Student). After entering data in New Group/New Student dialogs (for new student, I would have Combo Box from which I would select group to add into), group/student is added in proper data structure, and tree view is refreshed displaying new items.