Issue Details (XML | Word | Printable)

Key: SWINGX-1275
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: kleopatra
Reporter: trejkaz
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

JXTreeTable.getToolTipText(mouseEvent) : IllegalArgumentException: column must be valid, was-1

Created: 24/Feb/10 02:48 PM   Updated: 10/Jan/11 06:24 AM   Resolved: 10/Jan/11 06:24 AM
Component/s: TreeTable
Affects Version/s: 1.6
Fix Version/s: 1.6.3

Time Tracking:
Not Specified


Operating System: All
Platform: All

Issuezilla Id: 1,275
Participants: Karl Schaefer, kleopatra and trejkaz

 Description  « Hide

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(
at org.jdesktop.swingx.JXTreeTable.getToolTipText(
at javax.swing.ToolTipManager$insideTimerAction.actionPerformed(
at javax.swing.Timer.fireActionPerformed(
at javax.swing.Timer$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

Karl Schaefer added a comment - 24/Feb/10 07:50 PM

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


trejkaz added a comment - 25/Feb/10 03:44 PM

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.

kleopatra added a comment - 10/Jan/11 06:24 AM

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!