例如:
当在上JButton1单击JInternalFrame1显示时,JDesktopPane
以及在上JButton2单击JInternalFrame1关闭并JInternalFrame2显示时JDesktopPane。
在此之前
编辑:带有注释中的代码
if (JInternalFrame1 == null) {
JInternalFrame1 = new FJInternalFrame();
Desktop.add(JInternalFrame1);
JInternalFrame1.toFront();
} else {
JInternalFrame1.dispose();
}
Run Code Online (Sandbox Code Playgroud)