aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Application runs and closes automatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Application runs and closes automatically" Watch "Application runs and closes automatically" New topic
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: 19693
    
  20

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 - OCEEJBD 6
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Application runs and closes automatically