Hello,
I'd like to use Jtable in my JApplet.
I do :
String[] columnNames = {"lala", "toto", "mama" };
String[][] values = {
{ "val1", "val2", "val3" },
{ "toto1", "toto2", "toto3"}
};
JTable table = new JTable(values, columnNames);
myScrollPane.add(table);
...
This does work !
But I do not find how to change the values (and column names) of the
table. I tried Vectors instead of arrays, hoping that updateUI() would
update the table after a vector's change but no :-(
Any idea would be welcome...
Thx, Thierry
ak - 23 Nov 2003 21:17 GMT
if you want mutable table you must create JTable with TableModel
> Hello,
>
[quoted text clipped - 20 lines]
>
> Thx, Thierry
Thierry - 23 Nov 2003 22:09 GMT
Can you give an example pls ?
Thx
> if you want mutable table you must create JTable with TableModel
>
[quoted text clipped - 22 lines]
>>
>>Thx, Thierry
Christophe Vanfleteren - 23 Nov 2003 22:14 GMT
>>>But I do not find how to change the values (and column names) of the
>>>table. I tried Vectors instead of arrays, hoping that updateUI() would
[quoted text clipped - 7 lines]
>
> Thx
Read http://java.sun.com/docs/books/tutorial/uiswing/components/table.html,
it explains the relation between a JTable and a TableModel.

Signature
Regards,
Christophe Vanfleteren
Thierry - 24 Nov 2003 07:09 GMT
> Read http://java.sun.com/docs/books/tutorial/uiswing/components/table.html,
> it explains the relation between a JTable and a TableModel.
Actually, I did... but I don't get the part about the TableModel :-(