Disable JFrame when a new JFrame is opened(打开新的 JFrame 时禁用 JFrame)
问题描述
我试图在弹出新框架时禁用主"JFrame
.我想要它,这样您就不能在该框架上单击或拖动任何东西.我尝试将新框架设为 JDialog
,但这并没有禁用其他框架.我还查看了关于此的另一篇文章,其中建议将其设为 JDialog
但它仍然不起作用.我真的需要帮助来做这件事.谢谢.这是我用来制作JDialog
的codeIi,他们有什么问题吗?
I am trying to disable the "main" JFrame
when the new frame pops up. I want it so you can not click or drag anything on that frame. I tried making the new frame a JDialog
, but that did not disable the other frame. I also looked at the other post about this, which suggested to make it a JDialog
but it still does not work. I really need help doing this please. thanks. This is the codeIi am using to make the JDialog
, is their any problems with it?
editDialog=new JDialog(IntroScreen.frame);
IntroScreen.frame
代表主"框架.
推荐答案
你已经为 JDialog#setModal 或 JDialog#ModalityTypes,可能与 Dialog.ModalityType APPLICATION_MODAL
You have set for JDialog#setModal or JDialog#ModalityTypes, maybe with Dialog.ModalityType APPLICATION_MODAL
这篇关于打开新的 JFrame 时禁用 JFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:打开新的 JFrame 时禁用 JFrame


- Jersey REST 客户端:发布多部分数据 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01