题
其他提示
您可以实现使用JTable中的TableModel合并原来的TableModel的两列。
class Model2 extends AbstractTableModel
{
private TableModel delegate;
public Model2(TableModel delegate)
{
this.delegate= delegate;
}
public int getRowCount() { return this.delegate.getRowCount();}
public int getColumnCount() { return this.delegate.getColumnCount()-1;}
public Object getValueAt(int row, int col)
{
if(col==0) return ""+delegate.getValueAt(row,col)+delegate.getValueAt(row,col+1);
return delegate.getValueAt(col+1);
}
(...)
}
不隶属于 StackOverflow