Hi
I have a problem with JTable - i would like to reedit whole data like
this was on the beggining with default constructor like : JTable
table =new JTable(matrix1,matrix2);
When program runs i like to use different kind of data in this same
table( without erasing it ) - how to change it ?
Thank you very much
Sorry for my English - Poland
All the best
VisionSet - 01 Jan 2006 18:03 GMT
> Hi
>
[quoted text clipped - 7 lines]
> Sorry for my English - Poland
> All the best
If I understand you you wish to make updates to the tables data and these be
reflected in the JTable automatically.
To achieve this painlessly a good approach is to create a class that extends
AbstractTableModel and use this to create your JTable in JTables
constructor. All model updates will then fire JTables internal listener and
make the updates automatic.
--
Mike W
andreas kinell - 01 Jan 2006 18:18 GMT
> Hi
>
[quoted text clipped - 7 lines]
> Sorry for my English - Poland
> All the best
Try writing your own custom TableModel.
Then you could write a method called setValues(Matrix m1, Matrix m2)
which sets the matrices for you.
To detect changes to the model and update the JTable, use a
TableModelListener.
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data
HTH, andreas
JacQ_21 - 01 Jan 2006 21:00 GMT
Thank you all very much - it helped.
Big Thx