Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

JOptionPane HELP!! : On How To Disable The 'x' Close Buttton On showOptionDialog.  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm currently doing my java assignment and i need to use the jOptionPane to warn my users on some message and would like them to only select my two options only 'yes' and 'no' and I don't want my users to click on the close 'x' button to escape from my message for my jOptionPane. Can anyone help and if so any example i can refer to? Thank you..!
 
Marshal
Posts: 59717
187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It has something to do with setDecorated(false), or something similar. I think you should to do a search for "disable close button" or similar, because there is about one thread a year on that sort of subject.
 
Sheriff
Posts: 21421
94
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or disable the closing, by setting the default close operation to Frame.DO_NOTHING_ON_CLOSE. You may also need to remove one or more WindowListeners.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!