[SWINGX-1439] Duplicate nodes in JXTreeTable appearing as "Empty" nodes Created: 26/Apr/11 Updated: 27/Apr/11 Resolved: 27/Apr/11
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Attachments:||CustomTreeTableModel.java InsertTreeTableModel.java TestTreeTable.java TestTreeTableExample.java TestTreeTableExample_UPDATED.java|
This is about the rendering of a JXTreeTable.
Whenever the same instance of an object is inserted more than once to the tree component of a JXTreeTable, an empty node is being painted for every subsequent insertion.
We are not expecting those empty nodes.
To reproduce the problem:
|Comment by kleopatra [ 26/Apr/11 ]|
looks like a problem in your model implementation - same happens in a plain JTree as well, replace the relevant part
tree = new JTree(model);
BTW: better let the TreeModelSupport do the notification, that's why it's there
To track it down, first make it work in a plain tree, if it's working there and not in JXTreeTable, you hit a treeTable issue - and we'll dig here
|Comment by elisad [ 27/Apr/11 ]|
As you already said, using the old model implementation, the problem is also occurring in a "JTree".
I tried using the "TreeModelSupport" and it is working fine as I implemented it. You can check files [TestTreeTableExample_UPDATED.java and InsertTreeTableModel.java]
Could you please advise :
|Comment by kleopatra [ 27/Apr/11 ]|
my guess is the model implementation (JTree is too long around as that a major bug as that would have gone undetected.
As it's not a SwingX related problem, I'm closing this. Please feel free to reopen if all works correctly in a JTree but not in a JXTreeTable.
Well, as much as I love evaluating code and digging - this is a SwingX issue tracker, not a free debug resource for custom code You might want to go to any of the public forums (first a core Swing forum to make your model work in a JTree) to try and get further help.
Hmm ... on a quick glance: it's a tree structure - this implies that each node has exactly one parent (except the root, which has no parent). So you can't add the same node twice ... What you can do is to add the same user-object to different nodes
Thanks for your interest