May I make a remark ?
Extension is not the only way to use an object.
You say I extend the JFrame. Why ?
Does the new class is more specialized than the original ?
If it's the case, ok, let's extend it, but if not, avoid it.
Class A extends JFrame
{
JTable myTable; // to make it accessible in the class A
TableModel myTableModel; // idem
A()
{
super();
// you can use different layouts if you want.
// why not using JTable() instead of an extension of it.
myTable = new JTable();
myTableModel = new MyDataModel(); // extends the TableModel
myTable.setModel(myTableModel);
this.getContentPane().add(myTable);
}
}
------------------
Laurent
Leonard Laurent.Leonard@advalvas.be