| Author |
Application runs and closes automatically
|
Abder-Rahman Ali
Ranch Hand
Joined: May 22, 2008
Posts: 138
|
|
I have this code which is a JFrame with a JPanel and three buttons.
When I run the program it just closes AUTOMATICALLY. Why is that?
Thanks.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
What you think is a constructor isn't. It's a method that has the same name as a constructor would. Instead you are calling the default constructor that is generated automatically. Remove the "void" and see what happens.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Abder-Rahman Ali
Ranch Hand
Joined: May 22, 2008
Posts: 138
|
|
|
Thanks Rob, you are absolutely right.
|
 |
 |
|
|
subject: Application runs and closes automatically
|
|
|