private void notifyCheckSelectionChanged() { int min = -1; int max = -1; for (int i=0; i<getRowCount(); i++){ if (getValueAt(i, 0).equals(Boolean.TRUE)){ if (min == -1){ min = i; } max = i; } } for (ListSelectionListener l : checkSelListeners){ l.valueChanged(new ListSelectionEvent(CheckTable.this, min, max, false)); } }
private void notifyCheckSelectionChanged() { int min = -1; int max = -1; for (int i=0; i<getRowCount(); i++){ if (getValueAt(i, 0).equals(Boolean.TRUE)){ if (min == -1){ min = i; } max = i; } } for (ListSelectionListener l : checkSelListeners){ l.valueChanged(new ListSelectionEvent(CheckTable.this, min, max, false)); } }
private void notifyCheckSelectionChanged() { int min = -1; int max = -1; for (int i=0; i<getRowCount(); i++){ if (getValueAt(i, 0).equals(Boolean.TRUE)){ if (min == -1){ min = i; } max = i; } } for (ListSelectionListener l : checkSelListeners){ l.valueChanged(new ListSelectionEvent(CheckTable.this, min, max, false)); } }
/** * If all values are checked, uncheck them. * If any of them are not selected, select all. */ private void checkSelection() { boolean value = false; for (int row : getSelectedRows()){ if (getValueAt(row, 0).equals(Boolean.FALSE)){ value = true; } } for (int row : getSelectedRows()){ setValueAt(value, row, 0); } notifyCheckSelectionChanged(); }
/** * If all values are checked, uncheck them. * If any of them are not selected, select all. */ private void checkSelection() { boolean value = false; for (int row : getSelectedRows()){ if (getValueAt(row, 0).equals(Boolean.FALSE)){ value = true; } } for (int row : getSelectedRows()){ setValueAt(value, row, 0); } notifyCheckSelectionChanged(); }
/** * If all values are checked, uncheck them. * If any of them are not selected, select all. */ private void checkSelection() { boolean value = false; for (int row : getSelectedRows()){ if (getValueAt(row, 0).equals(Boolean.FALSE)){ value = true; } } for (int row : getSelectedRows()){ setValueAt(value, row, 0); } notifyCheckSelectionChanged(); }