How to perform an Action following a click on a part of a JXTable-Cell ?
I have to simulate the behaviour of the Plus/Minus-Expand/Collapse-NodeHandle of a Tree(Table) in a JXTable.
Yes, I considered using the JXTreeTable, but need filtering and sorting of the JXTable. :-)
I can think of two ways to accomplish this:
1. Using a CompoundComponent (+/- Button and TextField) as a CellEditor and immediately stop the CellEditing on a button-click. Then changing the filtered rows according to the state of the node (persisted in two properties of my DataClass.)
2. Handling the mouseclick as showing a popup menu on a Table; listen for a single click and identify the clicked (region of the) cell. The problem is getting the click coordinates IN the Component.
I searched the sources of JTree for hints, but got lost...
Can someone help me to exclude one of these "ideas" or direct me to a better solution?