From 48bc559b5d86617dcd9173c2d5301d15d4939e22 Mon Sep 17 00:00:00 2001 From: Mickaƫl Boiziot Date: Wed, 8 Jun 2016 10:35:42 +0200 Subject: [PATCH] Fix EDT violation: start the app in EDT. --- src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java b/src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java index e480ab3..39059bf 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java @@ -24,7 +24,6 @@ import javax.swing.SwingUtilities; import com.google.gson.Gson; import eu.omp.irap.vespa.epntapclient.gui.mainpanel.MainPanelCtrl; -import eu.omp.irap.vespa.epntapclient.gui.mainpanel.MainPanelView; /** * Simple class to have a main function to launch the EPNTap client. @@ -56,26 +55,25 @@ public class EpnTapMainApp { return; } - MainPanelCtrl guiCtrl = new MainPanelCtrl(); - guiCtrl.readServices(); - SwingUtilities.invokeLater(EpnTapMainApp.run(guiCtrl.getView(), "EPN-TAP client")); + SwingUtilities.invokeLater(EpnTapMainApp.run("EPN-TAP client")); } /** * Creates runnable used to run the application GUI. * - * @param voTableView The VOTable main view, created by the controller. * @param title The title of the application window. * @return The runnable. */ - private static Runnable run(final MainPanelView voTableView, final String title) { + private static Runnable run(final String title) { return new Runnable() { @Override public void run() { + MainPanelCtrl guiCtrl = new MainPanelCtrl(); + guiCtrl.readServices(); JFrame frame = new JFrame(title); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - frame.setContentPane(voTableView); + frame.setContentPane(guiCtrl.getView()); frame.setVisible(true); frame.pack(); frame.setLocationRelativeTo(null); -- libgit2 0.21.2