Fix sim table not taking proper spotlight

This commit is contained in:
SiboVG 2023-09-24 22:11:52 +02:00
parent 36e0cf2168
commit a47e2f416e

View File

@ -1404,6 +1404,9 @@ public class SimulationPanel extends JPanel {
* Focus on the simulation table and maintain the previous row selection(s). * Focus on the simulation table and maintain the previous row selection(s).
*/ */
public void takeTheSpotlight() { public void takeTheSpotlight() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
simulationTable.requestFocusInWindow(); simulationTable.requestFocusInWindow();
if (simulationTable.getRowCount() == 0 || simulationTable.getSelectedRows().length > 0) { if (simulationTable.getRowCount() == 0 || simulationTable.getSelectedRows().length > 0) {
return; return;
@ -1421,4 +1424,6 @@ public class SimulationPanel extends JPanel {
} }
updateActions(); updateActions();
} }
});
}
} }