reducing TriggerImage startup glitches

This commit is contained in:
Andrey 2022-03-19 21:28:43 -04:00
parent 2cb8235c6a
commit c0e26f99a6
1 changed files with 14 additions and 12 deletions

View File

@ -126,21 +126,23 @@ public class TriggerImage {
}; };
JPanel topPanel = new JPanel(new FlowLayout()); JPanel topPanel = new JPanel(new FlowLayout());
SwingUtilities.invokeAndWait(() -> {
content.add(topPanel, BorderLayout.NORTH); content.add(topPanel, BorderLayout.NORTH);
content.add(triggerPanel, BorderLayout.CENTER); content.add(triggerPanel, BorderLayout.CENTER);
f.showFrame(content); f.showFrame(content);
f.getFrame().setSize(900, 700); f.getFrame().setSize(900, 700);
SwingUtilities.invokeAndWait(new Runnable() { UiUtils.trueRepaint(content);
@Override });
public void run() {
SwingUtilities.invokeAndWait(() -> {
try { try {
generateImages(workingFolder, triggerPanel, topPanel, content); generateImages(workingFolder, triggerPanel, topPanel, content);
} catch (IOException e) { } catch (IOException e) {
throw new IllegalStateException(e); throw new IllegalStateException(e);
} }
}
}); });
Thread.sleep(1000 * sleepAtEnd); Thread.sleep(1000 * sleepAtEnd);
System.exit(-1); System.exit(-1);