In the following code, why is the "My Application" window the window at the front? The main method constructs this window first, right? So shouldn't it be at the back when the "My Window" JFrame is produced?
public class MyApp extends JFrame {
public MyApp() {
super();
setSize(300,600);
setTitle("My Application");
setVisible(true);
}
public static void main(String[] args) {
MyApp application = new MyApp();
JFrame window = new JFrame();
window.setSize(600,300);
window.setTitle("My Window");
window.setVisible(true);
}
}