Solved

JFrame application functions well, but still resident on exit

Posted on 2003-12-06
8
257 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spring jars download 1 52
Running JavaFX on JDeveloper 12C 1 76
Fast way to search item into Java Array (Rhino compatible) 2 37
Java Inheritance super keyword use 8 32
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

763 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