From ecbc5fd1e3292cc1d21fa83011699bc400636fec Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 13 Jun 2008 18:47:32 +0000 Subject: multi row deletion works --- sources/simulator/VSSimulator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sources/simulator/VSSimulator.java') diff --git a/sources/simulator/VSSimulator.java b/sources/simulator/VSSimulator.java index 49079a3..ac7588a 100644 --- a/sources/simulator/VSSimulator.java +++ b/sources/simulator/VSSimulator.java @@ -328,7 +328,7 @@ public class VSSimulator extends JPanel implements VSSerializable { * java.awt.event.MouseEvent) */ public void mouseClicked(MouseEvent me) { - JTable source = (JTable) me.getSource(); + final JTable source = (JTable) me.getSource(); final int row = source.rowAtPoint(me.getPoint()); final int col = source.columnAtPoint(me.getPoint()); @@ -336,8 +336,10 @@ public class VSSimulator extends JPanel implements VSSerializable { ActionListener actionListener = new ActionListener() { public void actionPerformed(ActionEvent ae) { String command = ae.getActionCommand(); + int rows[] = source.getSelectedRows(); if (command.equals(prefs.getString("lang.remove"))) { - removeTaskAtRow(row); + for (int i = rows.length - 1; i >= 0; --i) + removeTaskAtRow(rows[i]); } } }; -- cgit v1.2.3