![]() |
| ||
| GUI Window - Exit Button? Is there a cleaner way to close out of a GUI window in Java then just clicing the X in the upper right hand corner? When I do this I get a NullPointerException error. Is there a way to put an "Exit" button in a GUI window so that the window (program) closes much cleaner? I'm aware of the system.exit command, but that's not what I'm looking for. Any suggestions? |
| ||
| Re: GUI Window - Exit Button? I think System.exit is the quickest way shutdown apps in java. I usually disble the X button of the GUI and provide an exit menu for exiting. |
| ||
| Re: GUI Window - Exit Button? Quote:
|
| ||
| Re: GUI Window - Exit Button? if you get an exception on application shutdown there's something wrong with your application and you shouldn't blame the shutdown hook for it. As to providing a menu, check your Swing tutorials... |
| ||
| Re: GUI Window - Exit Button? As to specifically see javax.swing.JMenu API to insert menus in your app ... and to disable the X button : see javax.swing.JFrame --> setDefaultCloseOperation(int ) Quote:
|
| ||
| Re: GUI Window - Exit Button? Well. Thats a fine way I didn't knew before. Are there any possibilities to deactive or hide the "minimize" and the "downsize" Button? Thanks in advance Greetings from Germany Ben |
| ||
| Re: GUI Window - Exit Button? I'd guess that the JavaDoc for JFrame will tell you... |
| ||
| Re: GUI Window - Exit Button? Hmmm. I think 99 percent of the questions in this forum will be solved by reading the docs....... Why are you here then? |
| ||
| Re: GUI Window - Exit Button? If I can teach one person to learn to find their own answers I'll have helped one person... If I regurgitate code for everyone who wants some I've helped noone as they'll still not know how to find their own answers and will forever (or more likely until they end up in the unemployment line) come here for more and more. |
| ||
| Re: GUI Window - Exit Button? I didnt find any method doing your job .... however you can set a listener for minimizing the window ... if the window is minimized, then you should restore it and bring it to front again. |
| All times are GMT -4. The time now is 4:42 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC