Fix sim table keep selection after tab switch
This commit is contained in:
parent
485f1ad010
commit
687fb6f6e3
@ -998,8 +998,14 @@ public class SimulationPanel extends JPanel {
|
|||||||
*/
|
*/
|
||||||
public void takeTheSpotlight() {
|
public void takeTheSpotlight() {
|
||||||
simulationTable.requestFocusInWindow();
|
simulationTable.requestFocusInWindow();
|
||||||
if (simulationTable.getSelectedRowCount() == 0 && simulationTable.getRowCount() > 0) {
|
int selection = simulationTable.getSelectionModel().getAnchorSelectionIndex();
|
||||||
simulationTable.setRowSelectionInterval(0, 0);
|
if (selection == -1) {
|
||||||
|
if (simulationTable.getRowCount() > 0) {
|
||||||
|
selection = 0;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
simulationTable.setRowSelectionInterval(selection, selection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user