开发者

Event between X clicked/alt-F4 and windowsclosing() event

I'm making a application with a main JFrame and some threads. I use a windowslistener on my frame to detect for the closing event. But sometimes when i close the application (closing the mainframe), there is delay due to the threads. it appears that swing wait for all thread finish before calling the window开发者_Python百科sclosing() function. That delay can be a bit long (1-30seconds) so i would like to show a messagedialog "closing" like eclipse because for the user it seems that the application is not responding.

How can i get the event when the user attemp to close the windows not when the windows is actually closing ?

Sorry for my english :)

Thks in advance


You should close you threads manually. And there is two events callbacks: WindowClosing and WindowClosed

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜