marco
marco

Reputation: 297

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?

Upvotes: 2

Views: 645

Answers (1)

kleopatra
kleopatra

Reputation: 51525

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.

Upvotes: 1

Related Questions