So i have my AbstractTableModel:
public class ClientTableModel extends AbstractTableModel {
private String[] columns = new String [] {
"UserNames", "Passwords"
};
@Override
public int getRowCount() {
return ServerManager.instance.allClients.size();
}
@Override
public int getColumnCount() {
return columns.length;
}
@Override
public Class<?> getColumnClass(int columnIndex) {
return String.class;
}
@Override
public String getColumnName(int column) {
return columns[column];
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
Object value = "";
Client client = ServerManager.instance.allClients.get(rowIndex);
switch (columnIndex) {
case 0:
value = client.CLIENT_USERNAME;
break;
case 1:
value = client.CLIENT_PASSWORD;
break;
}
return value;
}
}
When i update the 'allClients' with a new client the JTable's row with the new client doesn't appear unless I resize the JTable.
I was wondering if it is possible for the JTable to update with the new client row without me having to manually resize the window to see the new client.