小编Sch*_*ner的帖子

当单击JButton并显示另一个JInternalFrame时,如何关闭JInternalFrame?

例如:

当在上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)

java swing jbutton jdesktoppane

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×1

jbutton ×1

jdesktoppane ×1

swing ×1