This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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.