• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDialog X Button

 
Karen Baog
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

How do I get rid of the X button on the top right corner of a JDialog box?

Thanks to all.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. You can disable it though. setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); That way, when the user hits the X, nothing will happen.
 
Karen Baog
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

How do I catch the event when the User clicks on the X button ?

Cheers!
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to register a WindowListener, as far as I remember.
 
Scott Delap
author
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might check this out:

Customizing Window Adornments
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic