JTable的问题(急!!)
为什么我的JTable里始终无法出现CheckBox的??
还有,在JTable建好以后还能把某一列的值改成CheckBox显示吗?怎么实现?
我的代码:
int i;
String strTableColumnNames[] = { "Select", "Product number", "Title", "Artiste's Name", "Price" };
ProductDetail product[] = eShopSys.collectProductInfo( nType, strQuery );
Object oTemp[][] = new Object[product.length][5];
for( i=0; product[i].strProductID != null; i++ )
{
oTemp[i][0] = new Boolean( false );
oTemp[i][1] = product[i].strProductID;
oTemp[i][2] = product[i].strTitle;
oTemp[i][3] = product[i].strArtisteName;
oTemp[i][4] = String.valueOf( product[i].fPrice );
}
productListTableModel = new DefaultTableModel( oTemp, strTableColumnNames ) {
public boolean isCellEditable(int row, int column) { // the table can't be edit now
return false;
} };
productListTable.setModel( productListTableModel );