Skip to main content

JXTreeTable: Data corruption issue on closing a branch while editing

2 replies [Last post]
Joined: 2003-07-15

Hi, seem to be getting NPE occationally, typically when a branch of a tree at the bottom of the table is being closed while editing (so that, after closing the branch, the initial row index at the editing node is more than the row count of the table after closing). Looks as if the tree is closed first and then the value is being set or something like that. Trace attached at the bottom.

Though I could live with this bug, I realized that, let's say my tree has root which has two children A, B and each has one children A1 and B1. Now, while I am editing A1 (row = 2), if I click on A, the value of A1 that I just entered is being set to B (after closing B is at row 2).
I tested this and am able to consistently reproduce it.

While we are at it, what if I don't want the user to close the branch till the edit is committed by the user in the cell? As in, if the partial edit is not valid, then I want to force the user to complete entering the right value before letting the user can close the branch.

at org.jdesktop.swing.JXTreeTable$TreeTableModelAdapter.nodeForRow(Unknown Source)
at org.jdesktop.swing.JXTreeTable$TreeTableModelAdapter.setValueAt(Unknown Source)
at javax.swing.JTable.setValueAt(
at org.jdesktop.swing.JXTable.setValueAt(Unknown Source)
at MyJXTreeTable.setValueAt(
at javax.swing.JTable.editingStopped(
at javax.swing.AbstractCellEditor.fireEditingStopped(
at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(
at javax.swing.DefaultCellEditor.stopCellEditing(
at javax.swing.JTable.editCellAt(
at org.jdesktop.swing.JXTreeTable.editCellAt(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.adjustFocusAndSelection(
at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mousePressed(
at java.awt.AWTEventMulticaster.mousePressed(
at java.awt.AWTEventMulticaster.mousePressed(
at java.awt.AWTEventMulticaster.mousePressed(
at java.awt.AWTEventMulticaster.mousePressed(
at java.awt.Component.processMouseEvent(
at java.awt.Component.processEvent(

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-16

Hi Siva,
Could you please file a bug with a suitable testcase that reproduces the bug. I will look into this
problem. Thanks,


Joined: 2003-07-15

Issue 120 has been logged for this with a testcase.