Solved

JFrame application functions well, but still resident on exit

Posted on 2003-12-06
8
254 Views
Last Modified: 2010-03-31
JFrame application functions well, but still resident on exit. I can do a ps on the process job an all are active processes in memory, which were run. I am doing a show() to display the JFrame and a dispose() on close.
Am I not shutting the app down properly?
0
Comment
Question by:rayskelton
  • 4
  • 4
8 Comments
 
LVL 92

Expert Comment

by:objects
ID: 9890013
You need to use System.exit(). Reason being that there are still threads running.
0
 
LVL 15

Assisted Solution

by:jimmack
jimmack earned 60 total points
ID: 9890121
Try adding the following to the JFrame.

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
0
 
LVL 92

Accepted Solution

by:
objects earned 65 total points
ID: 9890134
> setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

which make a call to System.exit() ;)
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9890149
That's right ;-)

Sorry objects I just got through answering another question (I hope you don't feel I'm treading on your toes here ;-)) where the author had used a WindowAdapter, so I thought I'd post the same line here ;-)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 92

Expert Comment

by:objects
ID: 9890224
> I hope you don't feel I'm treading on your toes here ;-)

not at all, just clarifying the difference.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9890240
Phew!

;-)
0
 
LVL 92

Expert Comment

by:objects
ID: 9890779
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9891576
;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 3 50
what is a "java.lang.System Property"   ? 20 57
netstat -ano | find "8000" and taskkill /f /pid 2984 3 39
session migration servlets 2 28
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now