void () { int selected = myTable.getSelectedRow(); if (selected >= myMigrationMap.getEntryCount() - 1) { return; } MigrationMapEntry entry = myMigrationMap.getEntryAt(selected); MigrationMapEntry nextEntry = myMigrationMap.getEntryAt(selected + 1); myMigrationMap.setEntryAt(nextEntry, selected); myMigrationMap.setEntryAt(entry, selected + 1); AbstractTableModel model = (AbstractTableModel)myTable.getModel(); model.fireTableRowsUpdated(selected, selected + 1); myTable.setRowSelectionInterval(selected + 1, selected + 1); }