How can I handle multiple rows selection in a JTable
? here is the code I have been using for selecting only one row:
table1 = new JTable();
table1.setModel(Ajmodel);
table1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent event) {
selectedAJ_ID = (Integer) table1.getModel().getValueAt(table1.getSelectedRow(), 0);
}
});
Thank you in advance.