gpt4 book ai didi

java - JFrame 打开时禁用其他操作

转载 作者:行者123 更新时间:2023-12-01 18:53:56 25 4
gpt4 key购买 nike

我想知道在 Java 中打开 JFrame 时是否可以禁用所有其他操作。

就这样吗?

enter image description here

有简单的代码吗?

最佳答案

这个问题已经被问过很多次了,答案总是相同的:使用模态 JDialog 或 JOptionPane(这是模态 JDialog 的一个版本),而不是另一个 JFrame。

例如,请查看 mKorbel 的回答 here .

关于java - JFrame 打开时禁用其他操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14819997/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com