简体   繁体   中英

How to disable iconified button in Menu bar in JFrame Window?

How to disable iconified button in JFrame Window ? something like setResizable, but for minimize button

You could use a JDialog, which natively does not have a minimize button.

In fact, the minimize, close and maximize/un-maximize buttons are drawn by the Operating System itself. This means you can't really disable them within Java.

That's why my suggestion is to use a JDialog.

At First, you can use the method setUndecorated(boolean). It may disable the title bar and the border.

In the end, you will create the icon label and close button at your frame top or the others position.

But this way will lose the border look and feel for the frame. If you choose this way, you must create a lot of code.

In fact, If you could not use JNI, this way may be the only.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM