MCPcopy Create free account
hub / github.com/f0ng/autoDecoder / removeSelectedRows

Method removeSelectedRows

src/burp/ui/JTableExample.java:287–301  ·  view source on GitHub ↗
(JTable table,DefaultTableModel tableModel)

Source from the content-addressed store, hash-verified

285
286 // 移除选中的行
287 private static void removeSelectedRows(JTable table,DefaultTableModel tableModel) {
288 int[] selectedRows = table.getSelectedRows();
289 if (selectedRows.length > 0) {
290 int result = JOptionPane.showConfirmDialog(table, "Are you sure you want to remove the selected rows?",
291 "Confirm Remove", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
292 if (result == JOptionPane.YES_OPTION) {
293 for (int i = selectedRows.length - 1; i >= 0; i--) {
294 tableModel.removeRow(selectedRows[i]);
295 }
296 }
297 } else {
298 JOptionPane.showMessageDialog(table, "Please select at least one row to remove.",
299 "No Rows Selected", JOptionPane.WARNING_MESSAGE);
300 }
301 }
302
303
304}

Callers 1

actionPerformedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected