Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hide x-Close-Button in a JDialog

 
Andy Jung
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
how is it possible to hide the x-Close-Button in the upper-right corner of a JDialog (I don't mean disable) ?
Kind regards,
Andy
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you would need to give java control of the titlebar
JDialog.setDefaultLookAndFeelDecorated(true);

then iterate the dialog's components to get the button, so it can be removed
 
Andy Jung
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... thanks, nice idea !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic