Forum Discussion
HKosova
Alumni
15 years agoHi Andrew,
You can get the total number of the selected rows in JTable and the selected row indexes using JTable's native getSelectedRowCount and getSelectedRows methods. So, for example, you can perform the validation by comparing the return value of the getSelectedRowCount method with the total number of table rows:
You can get the total number of the selected rows in JTable and the selected row indexes using JTable's native getSelectedRowCount and getSelectedRows methods. So, for example, you can perform the validation by comparing the return value of the getSelectedRowCount method with the total number of table rows:
if (table.getSelectedRowCount() == table.wRowCount)
{
// Checkpoint passed: All rows are selected
}
else
{
// Checkpoint failed: Not all rows are selected
}