Hi all
I have this little piece of code (JBuilder 2005):
====================================
public class myclass {
private static void showMain() {
MainFrame mainWin = new MainFrame();
mainWin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWin.setSize(500, 300);
mainWin.setResizable(false);
mainWin.show();
}
public static void main(String[] args) {
Runnable runSirios = new Runnable() {
public void run() {
showMain();
}
};
System.out.println("app end...");
}
}
====================================
everything compiles fine, but nothing happens. If I move the
showMain();
to outside the Runnable class it works fine. I am doing a call to a JFrame in the way that the "Sun JFC/Swing tutorial" recomends.
any help why this piece of code doesn�t work ?
I have this little piece of code (JBuilder 2005):
====================================
public class myclass {
private static void showMain() {
MainFrame mainWin = new MainFrame();
mainWin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWin.setSize(500, 300);
mainWin.setResizable(false);
mainWin.show();
}
public static void main(String[] args) {
Runnable runSirios = new Runnable() {
public void run() {
showMain();
}
};
System.out.println("app end...");
}
}
====================================
everything compiles fine, but nothing happens. If I move the
showMain();
to outside the Runnable class it works fine. I am doing a call to a JFrame in the way that the "Sun JFC/Swing tutorial" recomends.
any help why this piece of code doesn�t work ?