PDA

View Full Version : Listener and firing event about BaseTableModel?



hate2love
Aug 31st, 2004, 12:18 AM
my code is follows:

first: i extends BaseTableModel for storing my data,



public class MyTableModel extends BaseTableModel { }


second: i simulate PetClinic sample ant make a ViewTest class by Extending AbstractView class,



public class ViewTest extends AbstractView {
protected JComponent createControl() {
.............................
MutableTableModel tableModel = new MyTableModel();
JTable jTable = TableUtils.createStandardSortableTable(tableModel) ;
..............................
}
}


now, i can show a table in the application.

but, what i want to know is how the listener mechanism of this TableModel is implemented, and whether or not should i use TableModleEvent and TableModleListener in the javax.swing.event Packege?

I hope that you can explain the listener mechanism of rich client in detail by using this table example and give a simple example.

thanks!