I have an application that use awt and Swing, with this code :
public void windowClosing(WindowEvent e) {
Window window = e.getWindow();
if (window.equals(this)) {
setVisible(false);
dispose();
}
}
But when I close it some resources remain occuped and I can have prompt
until I press CTRL C. Why ?
_____
Flex 10 12007
"Flex" <fl******@ammsreprogrammareweb.com> wrote in message
news:pa****************************@ammsreprogramm areweb.com... I have an application that use awt and Swing, with this code :
public void windowClosing(WindowEvent e) { Window window = e.getWindow(); if (window.equals(this)) { setVisible(false); dispose(); } }
But when I close it some resources remain occuped and I can have prompt until I press CTRL C. Why ?
The easiest way to get your program to quit when you close the window is to
use the setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- Oliver
Il Fri, 05 May 2006 16:33:52 +0000, Oliver Wong ha scritto: The easiest way to get your program to quit when you close the window is to use the setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
It's the same, I don't understand why, but something remains open..
____
FleX
"Flex" <fl******@ammsreprogrammareweb.com> wrote in message
news:pa****************************@ammsreprogramm areweb.com... Il Fri, 05 May 2006 16:33:52 +0000, Oliver Wong ha scritto:
The easiest way to get your program to quit when you close the window is to use the setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
It's the same, I don't understand why, but something remains open..
Can you post an SSCCE demonstrating the problem? http://mindprod.com/jgloss/sscce.html
- Oliver
Il Fri, 05 May 2006 22:11:11 +0000, Oliver Wong ha scritto: Can you post an SSCCE demonstrating the problem? http://mindprod.com/jgloss/sscce.html
it'is not simple, because this is a big application, with some class, I
need a method to understand what remains open after exit.
___
FleX
Flex wrote: But when I close it some resources remain occuped and I can have prompt until I press CTRL C. Why ?
Like, command prompt? Well if run your program from command prompt (like
"java MyClass") of course then it will return to wherever it started
from... and that's command prompt.
If not, you didn't close the "main" thread (like JFrame thing Oliver
suggested) or have some other thread running.
--
Kova
"Flex" <fl******@ammsreprogrammareweb.com> wrote in message
news:pa****************************@ammsreprogramm areweb.com... Il Fri, 05 May 2006 22:11:11 +0000, Oliver Wong ha scritto:
it'is not simple, because this is a big application, with some class, I need a method to understand what remains open after exit.
What about having an observer that all the windows notify when they open
or close, and so the observer always has an accurate list of the open
windows, and can exit as appropriate?
- Oliver
Il Sat, 06 May 2006 20:37:42 +0200, Kova ha scritto: Like, command prompt? Well if run your program from command prompt (like "java MyClass") of course then it will return to wherever it started from... and that's command prompt. If not, you didn't close the "main" thread (like JFrame thing Oliver suggested) or have some other thread running.
I run the GUI program from a x-terminal and when I close it, javaVM
remain in memory, but I cannot understand why..
_____
FleX
Il Mon, 08 May 2006 14:00:57 +0000, Oliver Wong ha scritto: What about having an observer that all the windows notify when they open or close, and so the observer always has an accurate list of the open windows, and can exit as appropriate?
it's strange, when I try to run the application in debug mode (with
Netbeans) i receive this error :
Listening on 55850
User program running
Breakpoint hit at line 497 in class java.lang.Integer by thread main.
Thread main stopped at Integer.java:497.
and the application doesn't run.
____
FleX
"Flex" <fl******@ammsreprogrammareweb.com> wrote in message
news:pa****************************@ammsreprogramm areweb.com... Il Mon, 08 May 2006 14:00:57 +0000, Oliver Wong ha scritto:
What about having an observer that all the windows notify when they open or close, and so the observer always has an accurate list of the open windows, and can exit as appropriate?
it's strange, when I try to run the application in debug mode (with Netbeans) i receive this error : Listening on 55850 User program running Breakpoint hit at line 497 in class java.lang.Integer by thread main. Thread main stopped at Integer.java:497.
Remove the breakpoint, or press continue on the debugger.
- Oliver
Flex wrote: Il Sat, 06 May 2006 20:37:42 +0200, Kova ha scritto:
Like, command prompt? Well if run your program from command prompt (like "java MyClass") of course then it will return to wherever it started from... and that's command prompt. If not, you didn't close the "main" thread (like JFrame thing Oliver suggested) or have some other thread running.
I run the GUI program from a x-terminal and when I close it, javaVM remain in memory, but I cannot understand why..
_____ FleX
Have you tried adding System.exit(0); ???
It's a classic when it comes to closing an app... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rene Crespo |
last post by:
Hello,
I am using MSAccess 2000. I generated my application using my home PC and
then transfered the file to a server at work.
When I close the application, I get the following error: "Table...
|
by: Chuck |
last post by:
Hello everybody,
I need to abort execution during start up, while the constructor called by
Application.Run is executing.
If the database fails to connect during my application's startup I...
|
by: Zack Whittaker \(R2 Mentor\) |
last post by:
I think I'm starting to get the hang of this you know... bit by bit things are starting to
get much easier! :oD
Just wondering though, I've got a nice menu with popup dialogs with about boxes......
|
by: kong |
last post by:
i'm very new to asp.net...
i'm facing problem since i want to run the application...
i put my connection string (strConnect) in a module (moduleConnect)
then when my first form load, i want to...
|
by: tt |
last post by:
Hi,
ANy ideas on this? When I click the close button of a
window in VB.net which method gets called?
I used Applicaton.exit in some method of my appln. to
exit the application but, it still...
|
by: Simon |
last post by:
I need to force a exit if a critical file is not found???
|
by: Daniel |
last post by:
Hallo,
I'd like to hide application in Pocket PC. My application is written in
C# 2.0 for WM 5.0. I have some questions:
1. When it starts in takes about 5-6 seconds. The whole application...
|
by: nev |
last post by:
when i click the 'x' box of a form to exit i get the Error creating window handle.
but when i use my file menu exit menuitem which does...
Global.System.Windows.Forms.Application.Exit()
my...
|
by: dantz |
last post by:
Hi Everyone,
Currently I am having this exception:
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
I am still debugging which part of...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |