JTreeTable display problem
I've the following problem.. I've created a JTreeTable and a model which extends AbstractTreeTableModel. The problem is that my data are shown only if I call the fireTreeStructureChanged() method开发者_运维百科 after each inserting operation. In fact if I simple fire the method fireTreeNodesInserted(), nothing happens.
Besides, the data in my row are updated only after an add/remove event, if they simple change their value they are updated only after a click on the table.
How is it possible?
EDIT
When I call fireTreeStructureChanged() then it calls the method fireTableDataChanged(); instead the fireTreeNodesInserted(int firstRow, int lastRow) calls fireTableRowsInserted(); but maybe I pass to it the incorrect parameters...which first and last row I have to pass?
To alleviate the pain of event firing, SwingX has a helper class TreeModelSupport which is usable independent of the project
Edit
that is the standard way :-) A well tested 1:1 mapping of api doc in TreeModelEvent and TreeModelListener, reading it will help you understand.
精彩评论