Tell me, is it possible to remake this fragment so that only one selected row is deleted from the table? Created by DefaultTableModel and transferred to JTable

 class Udalenie1 implements ActionListener{ @Override public void actionPerformed(ActionEvent e) { int rows = model8.getRowCount(); for (int i=rows-1;i>=0;i--) { model8.removeRow(i); } } } 

    1 answer 1

    I think something like this: (if the table is a JTable)

     model.removeRow(table.getSelectedRow()); 
    • Thanks for the help) - Slava
    • @Slava, if my answer helped you, mark it as correct. - isnullxbh