given the following code:
public class MainFrame extends JFrame{
public MainFrame() throws HeadlessException {
super();
this.setSize(500, 400);
this.setVisible(true);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
JButton myButton = new JButton("Test");
this.add(myButton);
this.pack();
}
public static void main(String[] args) {
new MainFrame();
}
}
Does the code inside the constructor run on the EDT. I think it does because it's executed "inside" an instance of a JFrame, but I need a second opinion.
Continuing the idea, If I were to create other controls, for example in the main() function, that code wouldn't be on the EDT?
Thank you!