|
I'm know C#, but Java and C# are pretty similar, so maybe I can try and help with a little googling.
You sure there's no way to get rid of all the try's and catches? They are horrendously slow. Anyway, I found a nice PDF related to Java game development, and the segment on exiting the game is as follows: Don't know if that will help ya much, but I hope it does. ![]() ![]() ![]() ![]() ![]() ![]() |
|
I paid eleven minerals for THIS?
|
I have that book
The try-catch in the repeated methods is probably unnecessary, but also irrelevant. So far it just seems that shutdown hooks are not compatible with FSEM, but there really ought to be away to prevent alt-f4 exiting to result in a screen loss (I haven't tried running from a JAR - maybe the termination of the process will grab the screen back). Thanks for trying, and the pointer on try/catch. ![]() ![]() ![]() ![]() ![]() ![]() "Three can keep a secret, if two are dead." -Benjamin Franklin
"Had, having, and in quest to have, extreme; A bliss in proof, and proved, a very woe; Before, a joy proposed; behind, a dream. All this the world well knows; yet none knows well To shun the heaven that leads men to this hell." -William Shakespeare |
|
Wouldn't it be possible to disable alt + f4? I'm sure there must be a way; some games have alt + f4 disabled. Then you could either implement your own version of it or just not have it enabled at all.
This topic is from a long time ago however it may help in disabling alt + f4: http://forum.java.sun.com/thread.jspa?threadID=284195&messageID=1216200 Mainly this piece of code: setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); ![]() ![]() ![]() ![]() ![]() ![]() |
|
I paid eleven minerals for THIS?
|
That would certainly get around that method of force-exiting, and perhaps it should be enough. A comment on that thread talks about Sun fixing something in 1.4, do you know if this ever happened?
![]() ![]() ![]() ![]() ![]() ![]() "Three can keep a secret, if two are dead." -Benjamin Franklin
"Had, having, and in quest to have, extreme; A bliss in proof, and proved, a very woe; Before, a joy proposed; behind, a dream. All this the world well knows; yet none knows well To shun the heaven that leads men to this hell." -William Shakespeare |
|
I was reading that myself, I have no idea as I never really did much with Java.
I also found this: http://forum.java.sun.com/thread.jspa?threadID=5301341 It talks about thread priorities, and maybe that's what is causing your problem in full screen mode. ![]() ![]() ![]() ![]() ![]() ![]() |
|
I paid eleven minerals for THIS?
|
Manually handling the frame's closing with the window listener successfully catches most attempts to exit, so thanks for the help.
If any Java whiz feels like commenting on the thread issues, be my guest. ![]() ![]() ![]() ![]() ![]() ![]() "Three can keep a secret, if two are dead." -Benjamin Franklin
"Had, having, and in quest to have, extreme; A bliss in proof, and proved, a very woe; Before, a joy proposed; behind, a dream. All this the world well knows; yet none knows well To shun the heaven that leads men to this hell." -William Shakespeare |