Commit 48bc559b5d86617dcd9173c2d5301d15d4939e22
1 parent
65bbda5b
Exists in
master
Fix EDT violation: start the app in EDT.
Before entering in the SwingUtilities.invokeLater, hundred of graphicals operations were done outside the Event Dispatch Thread causing EDT violation. This commit, move the faulty operations inside the SwingUtilities.invokeLater to avoid that.
Showing
1 changed file
with
5 additions
and
7 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java
... | ... | @@ -24,7 +24,6 @@ import javax.swing.SwingUtilities; |
24 | 24 | import com.google.gson.Gson; |
25 | 25 | |
26 | 26 | import eu.omp.irap.vespa.epntapclient.gui.mainpanel.MainPanelCtrl; |
27 | -import eu.omp.irap.vespa.epntapclient.gui.mainpanel.MainPanelView; | |
28 | 27 | |
29 | 28 | /** |
30 | 29 | * Simple class to have a main function to launch the EPNTap client. |
... | ... | @@ -56,26 +55,25 @@ public class EpnTapMainApp { |
56 | 55 | return; |
57 | 56 | } |
58 | 57 | |
59 | - MainPanelCtrl guiCtrl = new MainPanelCtrl(); | |
60 | - guiCtrl.readServices(); | |
61 | - SwingUtilities.invokeLater(EpnTapMainApp.run(guiCtrl.getView(), "EPN-TAP client")); | |
58 | + SwingUtilities.invokeLater(EpnTapMainApp.run("EPN-TAP client")); | |
62 | 59 | } |
63 | 60 | |
64 | 61 | /** |
65 | 62 | * Creates runnable used to run the application GUI. |
66 | 63 | * |
67 | - * @param voTableView The VOTable main view, created by the controller. | |
68 | 64 | * @param title The title of the application window. |
69 | 65 | * @return The runnable. |
70 | 66 | */ |
71 | - private static Runnable run(final MainPanelView voTableView, final String title) { | |
67 | + private static Runnable run(final String title) { | |
72 | 68 | return new Runnable() { |
73 | 69 | |
74 | 70 | @Override |
75 | 71 | public void run() { |
72 | + MainPanelCtrl guiCtrl = new MainPanelCtrl(); | |
73 | + guiCtrl.readServices(); | |
76 | 74 | JFrame frame = new JFrame(title); |
77 | 75 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
78 | - frame.setContentPane(voTableView); | |
76 | + frame.setContentPane(guiCtrl.getView()); | |
79 | 77 | frame.setVisible(true); |
80 | 78 | frame.pack(); |
81 | 79 | frame.setLocationRelativeTo(null); | ... | ... |