Posted By:
Aleksey_Skorokhodov
Posted On:
Tuesday, April 2, 2002 12:17 AM
I have a JTable. I would like to save its state when user exits the application. I know how to save the table model - it's easy :). The problem I have for now is - where (how?) to store the table column model? store the headers in tablemodel? I think it's not good to use a code like this: String[] headers = {"From", "Subject", "Date", "Size"}; DefaultTableModel data = new DefaultTableModel(headers, 0) because I'd like to manipulate the columns freely. Maybe I should create my own MailTableColumnModel, I suppose I should use somethink like class MailTableColumnModel extends DefaultTableColumnModel This va
More>>
I have a JTable. I would like to save its state when user exits the application. I know how to save the table model - it's easy :).
The problem I have for now is - where (how?) to store the table column model? store the headers in tablemodel?
I think it's not good to use a code like this:
String[] headers = {"From", "Subject", "Date", "Size"};
DefaultTableModel data = new DefaultTableModel(headers, 0)
because I'd like to manipulate the columns freely.
Maybe I should create my own MailTableColumnModel,
I suppose I should use somethink like
class MailTableColumnModel extends DefaultTableColumnModel
This variant of code is being compiled OK, tablecolumnmodel is stored OK,
but my table is NOT visible.
I'll try to explain:
I have a JTable with
1) datamodel which really contains data
2) tablecolumnmodel with 2 columns
but the table is not visible. Ehh.. maybe my question is not so clear?..
Maybe I should add columns definitions both in datamodel in columnmodel?..
<<Less