[SWINGX-1275] JXTreeTable.getToolTipText(mouseEvent) : IllegalArgumentException: column must be valid, was-1 Created: 24/Feb/10  Updated: 10/Jan/11  Resolved: 10/Jan/11

Status: Resolved
Project: swingx
Component/s: TreeTable
Affects Version/s: 1.6
Fix Version/s: 1.6.3

Type: Bug Priority: Major
Reporter: trejkaz Assignee: kleopatra
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: All
Platform: All

Issuezilla Id: 1,275


I'm still not sure exactly how I got this to happen, but I was moving the mouse over a JXTreeTable and
got the following error. Perhaps instead of throwing IllegalArgumentException, isHierarchical should
silently return false for indices which are out of bounds?

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: column must be valid, was-1
at org.jdesktop.swingx.JXTreeTable.isHierarchical(JXTreeTable.java:1760)
at org.jdesktop.swingx.JXTreeTable.getToolTipText(JXTreeTable.java:1197)
at javax.swing.ToolTipManager$insideTimerAction.actionPerformed(ToolTipManager.java:658)
at javax.swing.Timer.fireActionPerformed(Timer.java:271)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Comment by Karl Schaefer [ 24/Feb/10 ]

There is some interaction with the tool tip. Can you please provide a small,
runnable demo showcasing the problem?


Comment by trejkaz [ 25/Feb/10 ]

It seems like the sequence of events is:

  • mouse is in the table somewhere, getting a tooltip (problem is I don't
    remember where - and our table has no tooltips.)
  • timer fires
  • at around the same time, the mouse moves to outside the table, and
    presumably whatever fired the timer off didn't record the original
    position of the mouse, and is instead asking where it is now.
  • columnAtPoint returns -1 because it isn't over a column

But I can't manually reproduce it as my timing isn't perfect when it needs to be,
only when it doesn't.

Comment by kleopatra [ 10/Jan/11 ]

the problem is in getToolTipText: it doesn't guard against columnAtPoint() being -1, which
happens if the mouse event is somewhere outside

fixed as of revision #3913

  • added check for column == -1
  • added test

Thanks for reporting!

Generated at Mon Apr 24 21:44:22 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.