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