Skip to main content

JXTreeTable ... Bug

4 replies [Last post]
elskwi_
Offline
Joined: 2011-01-29
Points: 0

Hello
I post bug here because it's really difficult to submit something using pages of SwingX project.(And also all projects, 30 minutes to find nothing)
Then :
Priority : Low (P5, I guess)
OS : Linux Debian Squeeze 64bits
JDK : 1.6.0_23, using nimbus L&F
API : swingx-1.6.2
Bug Target : JXTreeTable
How : Initialize a JXTreeTable with no data, an event is launched to display tool tip text.
Reproductible : every time
Stack Trace : (Just the minimum) :
java.lang.IllegalArgumentException: column must be valid, was-1
at org.jdesktop.swingx.JXTreeTable.isHierarchical(JXTreeTable.java:2022)
at org.jdesktop.swingx.JXTreeTable.getToolTipText(JXTreeTable.java:1459)
The system try to get column index, the model has NO Columns and No Lines
Old Code :
@Override
public String getToolTipText(MouseEvent event) {
int column = columnAtPoint(event.getPoint());
if (isHierarchical(column)) {
int row = rowAtPoint(event.getPoint());
return renderer.getToolTipText(event, row, column);
}
return super.getToolTipText(event);
}

Purposed Code :
@Override
public String getToolTipText(MouseEvent event) {
// Elskwi : no need to get a tool tip when there is nothing inside table
if (this.dataModel.getColumnCount() == 0 || this.dataModel.getRowCount() == 0) {
return null;
}
int column = columnAtPoint(event.getPoint());
if (isHierarchical(column)) {
int row = rowAtPoint(event.getPoint());
return renderer.getToolTipText(event, row, column);
}
return super.getToolTipText(event);
}

I hope this little quick fix is correct and let you gain time.

Have a nice day

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kleopatra
Offline
Joined: 2003-06-11
Points: 0

yeah, this site is in migration - causing even more inconveniences than we are already used to ;-)
The bug is solved a couple of weeks ago, I think. Please check (or its copy over at kenai where you most probably can comment on it as well, don't know) it that's really the case:
https://swingx.dev.java.net/issues/show_bug.cgi?id=1275
Thanks for the detailed report :-)
Jeanette

elskwi_
Offline
Joined: 2011-01-29
Points: 0

Hi Jeanette.
Ok, I hope it will be possible to connect soon on the new site, it seems I am coming not at the right time one time again.
Thanks for the URL with issues, is this mean I don't use the last release of SwingX ?

I think I should get source from repository to apply the patch that has been done.

For the report, this is the minimum a software developer can do for an other software developer. ;-)

Cedric

kleopatra
Offline
Joined: 2003-06-11
Points: 0

Cedric,
1.6.2 is the most recent release - bug fixing is happening all the time :-) Yeah, grabbing a snapshot (the only reliable way is by checking out the rep from the new site, afaik) is the way to go to get all bug fixes since the last release.
Cheers
Jeanette

elskwi_
Offline
Joined: 2011-01-29
Points: 0

Hi Jeanette,
Your bug fix works like a charm,
thanks a lot !

Cédric