Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non-ending program with JOpenPane

Status
Not open for further replies.

jarlef

Programmer
Jan 24, 2003
1
CA
This little program:

import javax.swing.*;
public class Test {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "Hello!");
}
}

...shows the dialog box but does not seem to terminate as the Windows console remains open afterwards. It looks like something needs to be cleaned up following the use of this JOpenPane dialog box, but what?

I know that I can use System.exit(0) to terminate this by aborting the program, but it doesn't seem like the "correct" solution to this particular case...
 
For this program System.exit(0) is the most common way to close the Windows console
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top