Java 删除JInternalFrame默认标题栏
我正在尝试删除一个Java 删除JInternalFrame默认标题栏,java,swing,jinternalframe,Java,Swing,Jinternalframe,我正在尝试删除一个JInternalFrame的标题栏,我尝试了这个 void remove_title_bar(){ putClientProperty("JInternalFrame.isPalette", Boolean.TRUE); getRootPane().setWindowDecorationStyle(JRootPane.NONE); BasicInternalFrameTitlePane titlePane =
JInternalFrame
的标题栏,我尝试了这个
void remove_title_bar(){
putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
BasicInternalFrameTitlePane titlePane =
(BasicInternalFrameTitlePane) ((BasicInternalFrameUI) this.getUI()).
getNorthPane();
this.remove(titlePane);
this.setBorder(null);
//this.setUI(null); doesn't work either
}
它不会删除标题栏,而是将其清除,我的意思是我看到标题栏空白(顶部为白色矩形)。
如何删除它?我找到了这段代码,是的,它可以工作(至少对我来说是这样)。
如果这不是一个好方法,请告诉我
void remove_title_bar(){
putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
((BasicInternalFrameUI) this.getUI()).setNorthPane(null);
this.setBorder(null);
}
+1但不使用
getRootPane().setWindowDecorationStyle(JRootPane.NONE)工作代码>,除此之外,你真的想从JInternalFrame建模吗?我必须删除标题栏,因为默认UI与应用程序主题不同步。我知道这听起来很奇怪,但是顾客,奇怪的订单,到处都是奇怪的订单!。我必须手动调整新框架的大小、移动和图标化。非常感谢您的编辑:D@mKorbeldid您尝试了一些od(定制???)外观和感觉,其中一部分(作者)是为了克服这一缺点decorations@mKorbel是的,当然,但他们中的一些人只是使用默认(OS)UI作为标题栏,我必须按照他们的意愿装饰它,可怜的我:D@mKorbel物质是好的,但是很重!也没有任何好的文档。最糟糕的是,每个新版本(发行版)都与上一个版本不兼容。