Should Swing GUI application be controlled from Event Dispatcher or main thread?
I've read a few books about Java. In all of them there was at least one chapter teaching GUI programming. In all of them, creating a simple form application was following this logic: MyFrame.java public class MyFrame extends JFrame { JButton button1; public MyFrame() { button1 = new JButton("Click here."); } } FrameTest.java: public class FrameTest { public static void main(String[] args) { MyFrame myFrame = new MyFrame(); myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); myFrame.setSize(600, 600); myFrame.setVisible(true); } } Basically, just subclass JFrame to create a form and declare