posted 19 years ago
One approach you can take is to write your own class extending AbstractTableModel which will be used as the model for your JTable. If you do extend this class, there are 3 methods that need to be overwritten:
public int getRowCount();
public int getColumnCount();
public Object getValueAt(int row, int column);
Also this model is where you will handle making cells non-editable...changing cell renderers so that you can do things like implement JComboBox instead of the default renderer, etc etc.
Do a quick google on AbstractTableModel and you'll find plenty of resources.
David
Dad always thought laughter was the best medicine, which I guess is why several of us died of tuberculosis. -Jack Handy