Solved

JFrame application functions well, but still resident on exit

Posted on 2003-12-06
8
255 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

776 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