Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个小程序,上面有两个按钮:
当我们单击Button1时,会打开一个框架。 当我们单击Button2时,会显示一个对话框(它是新框架的子框架)。
现在假设如果当我们单击Button1时,打开的新框架现在位于我的小程序后面,并且没有完全对齐(未最小化)
现在,当我按下Button2时,弹出的对话框就在我的小程序前面,但是当我单击对话框的标题时,小程序和框架都会向前移动(它们都同时显示)。
所以我基本上只想在单击对话框时将小程序放在对话框后面(将框架留在背景中)
frame.setVisible(false);在Button2的 ActionListener中添加一个。
frame.setVisible(false);