Message Board
Message Board > Java > remove the "x" close button in a dialog box |
March 11, 2007, 00:58 | |
DTM
Earthling! 823 posts |
I have a showConfirmDialog with options yes/no, at the moment the user can just ignore the options if they like and click the "x" to get rid of it. Is there a way to disable the "x" button? ____________ :o |
# |
March 11, 2007, 01:16 | |
Frimkron
Frustrated Megalomaniac 703 posts |
I believe you will have to write your own extension of JDialog and call setDefaultCloseOperation (or whatever its called). There's an option called DO_NOTHING_ON_CLOSE which makes the X button ineffective. This is from memory so I could be wrong. Alternatively, couldn't you put the dialog in a loop and only break if a proper response was obtained? ____________ |
# |
March 11, 2007, 03:01 | |
DTM
Earthling! 823 posts |
Quote: Alternatively, couldn't you put the dialog in a loop and only break if a proper response was obtained? Yes! I will do that. ____________ :o |
# |
March 11, 2007, 04:43 | |
Sandman
F3n!x0r 1194 posts |
Doesn't closing the window mean the user doesn't want anything to change? In most cases implying a 'no'?
____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
March 12, 2007, 13:02 | |
Mezzmer
Square-theorist 792 posts |
are you wanting to send nasty popup windows to people now??
____________ |
# |
March 12, 2007, 13:02 | |
Mezzmer
Square-theorist 792 posts |
ah you want an options dialog my opinion is that the DO_NOTHING_ON_CLOSE option would annoy people if they see a button they cannot press. the best way is to not use a dialog bog? [Edited on March 12, 2007 by Mezzmer] ____________ |
# |
March 12, 2007, 18:18 | |
DTM
Earthling! 823 posts |
It's for the end of this "game" (a.k.a coursework-thing-that's-not-really-a-game) and it asks "Play again?". But i've done it now. Ooh I could submit it to full games. Or not. ____________ :o |
# |
March 12, 2007, 18:55 | |
Mezzmer
Square-theorist 792 posts |
yes, if it's a good game! but if it's crap don't bother ____________ |
# |
March 13, 2007, 20:29 | |
DTM
Earthling! 823 posts |
I hate java. Do people like, do testing and stuff in the real world? For my next assignment I have to do a testing strategy. And use something called JUnit. Maybe I don't hate java. MAYBE JUST MAYBE I hate testing. Although actually the testing is only 15% so I don't really have to do it. But MAYBE JUST MAYBE it's assignments I hate. Oh and yes it is crap. Also I hate Eclipse. This is a rant by the way. ____________ :o |
# |
March 13, 2007, 23:50 | |
Rincewind
programmer 1548 posts |
Quote: people like, do testing and stuff in the real world? For my next assignment I have to do a testing strategy. Ha, recognisable! I have to do full 'designs' before I am actually allowed to start programming, with the 'design' being the code whole programmed out except the 'branch' methods which call no deeper nested methods. I see no other way but to reverse-engineer a finished program to a 'design' and then submit both. Not to mention the dogmatic way you must name variables/methods/classes. Otherwise you're missing points for not sticking to the name dress code! Errr. University makes programming fun! It probably also sparks whole generations of programming-haters. I've also made a game in Java. Console mastermind, isn't that cute? And my last two program being a tree of pythagoras and a Conway's life program, stuff I've programmed before years ago. Not that I mind, it only makes it a lot quicker to do now so I can work on important things, like Fenix games! This is a little rant as well. One way or another, while the dogmatic ways there is being taught at university are bothering, I'm sure we're having a huge advantage over those who are newly introduced to programming. [Edited on March 14, 2007 by Rincewind] ____________ Personal website: http://www.loijson.com |
# |
March 14, 2007, 23:51 | |
Sandman
F3n!x0r 1194 posts |
Not all people have the luxury of previous programming knowledge, so some shit might seem easy. Also, that designing you say is really handy. I use it with mu Java shit as well and it does do the trick for an OO language. This was not a rant! ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
Message Board > Java > remove the "x" close button in a dialog box