Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDialog

 
Vaskar Dasgupta
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i disable the x button on the top right corner of JDialog ?
 
Jennifer Garrett
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this line after you define dialog as the JDialog:
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE );
 
Vaskar Dasgupta
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Jennifer for your response, i have tried that option but unfortunately the line of code you suggested only removes the functionality of the button, i am looking forward to something like making the button GRAYED in color (Like you see it in windows, a grayeed disabled button .....)
Waiting for your response.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic