本文介绍了如何禁用(或隐藏)JFrame上的关闭(x)按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个窗口(从JFrame派生),我想在某些不可中断的操作中禁用关闭按钮。我知道我可以通过调用
I have a window (derived from JFrame) and I want to disable the close button during certain operations which are not interruptible. I know I can make the button not do anything (or call a handler in a WindowListener) by calling
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
但我想直观地说明点击它是没有意义的。
but I would like to make it clear visually that it is pointless to click it.
推荐答案
如果我理解正确的话,表明目前无法做到这一点。
If I understand it correctly, this bug report indicates that this is currently not possible.
这篇关于如何禁用(或隐藏)JFrame上的关闭(x)按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!