• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Close Button

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic