I have a JTree that implements multi selection logic.
This works great when I do all my selections using the mouse + Ctrl key pressed. If user makes selections with the Ctrl key unpressed it breaks my logic.
I can’t really see why it breaks but I think that a possible solution is to always indicate the TreeSelectionModel that the selection has been make with the Ctrl key pressed.
What would you suggest?
I think I’ve found the solution
You will need to extend JTree and DefaultTreeSelectionModel.
JTree relevant methods:
DefaultSelectionModel relevant methods :
HTH.