Solved

JFrame application functions well, but still resident on exit

Posted on 2003-12-06
8
253 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
Comment Utility
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
Comment Utility
Try adding the following to the JFrame.

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
0
 
LVL 92

Accepted Solution

by:
objects earned 65 total points
Comment Utility
> setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

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

Expert Comment

by:jimmack
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 92

Expert Comment

by:objects
Comment Utility
> 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
Comment Utility
Phew!

;-)
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
0
 
LVL 15

Expert Comment

by:jimmack
Comment Utility
;-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
stringclean challenge 26 55
wordlen challenge 3 46
Starting to learn JAVA, 7 47
thymeleaf natural templating vs JSP 2 23
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

744 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

16 Experts available now in Live!

Get 1:1 Help Now