[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 395
  • Last Modified:

JFrame Close Icon

How do I create a JFrame and get rid of the close icon in the upper right corner?
0
jaiken
Asked:
jaiken
1 Solution
 
kylarCommented:
You can't. Your only choices are to live with it or use a JWindow (which has no title bar at all). Lastly, you could catch the close event and have it do nothing.

Cheers,
Kylar
0
 
Igor BazarnyCommented:
Hi,

You don't even need to 'catch the close event' to prevent window closing. Just call setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE). But there is no way to change set of buttons shown.

Regards,
Igor Bazarny,
Brainbench MVP for Java 1
www.brainbench.com
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now