wood burning stoves 2.0*
The moose likes Java in General and the fly likes Close Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Close Button" Watch "Close Button" New topic
Author

Close Button

Noman Iqbal
Ranch Hand

Joined: Jun 25, 2001
Posts: 99
Hi Dear friends,
Can any body tell me that in awt how to disable the minimize, maximize and close buttons of a Frame, remember I don't need to disappear these buttons but to disablethem, means that they will be visible but will not be able to press. Waiting for your reply.
bye
Noman Iqbal.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

I don't think you can really disable them ( other than maximize... ) without JNI... but here's some code that shows the closest I can get to it...



Basically, it just eats WindowIconified and WindowClosing events... unfortunatly, the events are sent in response to the actual event occuring... so you don't get a WindowIconified event until after the window is already iconified... Unfortunately, disableEvents() doesn't mean what you think it does at first glance... Also, the buttons are not displayed as disabled, but I think this is because they aren't Java buttons... they are actually Windows buttons...

What about using a Window instead of a Frame? That leaves those pesky buttons off entirely...



-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
Don't get me started about those stupid light bulbs.
 
subject: Close Button
 
Similar Threads
Nested Layouts
How to Hide the browser Close & minimise button
JOptionPane with no buttons
Displaying the close,min and max button on the left of JFrame
Disable Minimize and Close buttons