Here is problem I have main game thread and using JFrameJFrame on setVisible create not daemon Thread AWT-EventQueueSo when my main process Thread do all work,and I don’t have other no deamon thread Application still runningTo finish it need or hide JFrame or use System.exit

The problem in error Exception,The standard way is surround main functiontry{}catch or finallyBut I need debug in Eclipse start Exception and try{} block skip it.For fix error in debug mode.

So we need make some action on Exception not using try{}

Here is my solutionCloser Thread something similar like base JVM Check for no daemon

I have no idea what your question is, or what your problem is, but I'm guessing that you forgot to do

1

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

on your JFrame. That'll close the app, once the window closes.

Not really what I am talking about

And what if You have custom Process Thread that handle player actions etc..And game in fullscrean mode or setUndecorated(true); you simple don’t have “X” button to close windowand all game action stopped because Main Process Thread fishisedso you cant exit simple way only Use try{} block,to catch Exception in Thread and then finish Process.

Update:In my case I Have 2 Threads: 1 Procces(not daemon) and 2 Client(daemon),so you think if main thread(Procces) stops - Application will be closed,But no - Thread AWT-EventQueue don’t give you close Application.I don’t find way to make Thread AWT-EventQueue Daemon.

And I cant use try{} because I need debug problem,That’s why I create “Close” Thread ^^

p.s it is difficult to understand this problem until you meet the problem themselves

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org