Grazie per la tua risposta celere.
Ti invio il model ... Come dovrei modificarlo (sono un po inesperto in materia ...)
La mia riga di tabella è la seguente:
codice:
class ProfileActivateRow
{
private int ProfileId;
private String ProfileName;
private int UserMaxNumber;
private boolean MM_Conf;
private boolean MM_Monitor;
private boolean MC_Conf;
private boolean MC_Monitor;
private boolean MI_Conf;
private boolean MI_Monitor;
public boolean getMM_Conf()
{
return MM_Conf;
}
public void setMM_Conf(boolean MM_Conf)
{
this.MM_Conf = MM_Conf;
}
.....
}
Mentre il Model:
codice:
public class ProfileActivateTableModel extends AbstractTableModel
{
public final String[] COLUMN_NAMES = new String[] {"Profile", "MM-Conf" , "MM-Monitor", "MC-Conf", "MC-Monitor", "MI-Conf", "MI-Monitor"};
private Vector<ProfileActivateRow> tableData = new Vector<ProfileActivateRow>();
/*
* getRowCount: Returns the number of rows in the model.
*/
public int getRowCount()
{
return tableData.size();
}
public boolean isCellEditable(int rowIndex, int columnIndex)
{
return true;
}
public int getColumnCount()
{
return COLUMN_NAMES.length;
}
public String getColumnName(int columnIndex)
{
return COLUMN_NAMES[columnIndex];
}
public Object getValueAt(int rowIndex, int columnIndex)
{
if( columnIndex == COL_PROFILE ) {
return tableData.get(rowIndex).getProfileName();
}
if( columnIndex == COL_MM_CONF ) {
return tableData.get(rowIndex).getMM_Conf();
}
if( columnIndex == COL_MM_MONITOR ) {
return tableData.get(rowIndex).getMM_Monitor();
}
if( columnIndex == COL_MC_CONF ) {
return tableData.get(rowIndex).getMC_Conf();
}
if( columnIndex == COL_MC_MONITOR ) {
return tableData.get(rowIndex).getMC_Monitor();
}
if( columnIndex == COL_MI_CONF ) {
return tableData.get(rowIndex).getMI_Conf();
}
if( columnIndex == COL_MI_MONITOR ) {
return tableData.get(rowIndex).getMI_Monitor();
}
return null;
}
public ProfileActivateRow getRowValue(int rowIndex)
{
return tableData.get(rowIndex);
}
public void removeAll()
{
tableData.removeAllElements();
fireTableDataChanged();
}
public void removeData(int pRow)
{
tableData.removeElementAt(pRow);
fireTableDataChanged();
}
public void addDataTransaction(ProfileActivateRow pOneRow)
{
tableData.add(pOneRow);
}
public void commitAddDataTransaction()
{
fireTableDataChanged();
}
public void removeAllElements()
{
synchronized (tableData) {
tableData.removeAllElements();
}
}
}