Remove redundant row query
This commit is contained in:
parent
b42acb5416
commit
39100f76f6
@ -208,13 +208,10 @@ public class SimulationPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
// Show context menu
|
// Show context menu
|
||||||
else if (e.getButton() == MouseEvent.BUTTON3 && e.getClickCount() == 1) {
|
else if (e.getButton() == MouseEvent.BUTTON3 && e.getClickCount() == 1) {
|
||||||
// Get the row that the right-click action happened on
|
|
||||||
int r = simulationTable.rowAtPoint(e.getPoint());
|
|
||||||
|
|
||||||
// Select new row
|
// Select new row
|
||||||
if (!simulationTable.isRowSelected(r)) {
|
if (!simulationTable.isRowSelected(row)) {
|
||||||
if (r >= 0 && r < simulationTable.getRowCount()) {
|
if (row >= 0 && row < simulationTable.getRowCount()) {
|
||||||
simulationTable.setRowSelectionInterval(r, r);
|
simulationTable.setRowSelectionInterval(row, row);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user