This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Originally posted by Sachindra Pratap: hi, In my swing application ,i want to remove the close icon which comes at upper right cornor of the window. I want to logout my application, by making use of logout button which i have put.
please convey the solution!.
I dont think it is possible to do this without messing around with the ComponentUI.
However, if you set the which is the default behavior and add your own window listener, you can get notified when the user attempts to close the application window and process the event the way you want to. [ September 18, 2008: Message edited by: Maneesh Godbole ]
I'm too lazy to search for the thread(s) about this topic (but you certainly are welcome to, I think there's at least two with relevant code/discussion), but here's a bit of code I found that seems to work in L&Fs excluding the Windows L&F on XP; it removes all buttons on the title bar:
Call it with the frame you want to remove buttons on.
I would have to recommend Mr. Godbole's suggestion if you are planning to deploy an app on XP.