I use JXTable and JXTableHeader to display sortable tables. JXTableHeader supported a way to reset sort order, by holding down shift and left clicking on the headers at the same time. The problem is the following: This reset mode is not possible atm, becuse Java Swing's BasicTableHeaderUI adds a mouse listener to JXTableHeader and eventhough I add my own listener to JXTableHeader, BasicTableHeaderUI's gets triggered and although I reset sort order in my listener's mouseClick method, the BasicTableHeaderUI's immediately sets the same column to be sorted in its own mouseClick method. Problem #2, I cannot use consume on the event, since BasicTableHeaderUI's listener just ignores the flag.
How can I prevent BasicTableHeaderUI's listener to be triggered in a clean way?
Solution:
This is the solution I went with. I implemented a wrapper for the BasicTableHeaderUI's MouseListener and changed that to my wrapper on updateUI. My wrapper just ignores the wrapped MouseListener's mouseClick call on a certain condition (-> resetSortOrder).