隐藏JInternalFrame的标题栏? -java [英] hiding title bar of JInternalFrame? -java

查看:68
本文介绍了隐藏JInternalFrame的标题栏? -java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上找到了一些代码,我对其进行了一些编辑.我想隐藏JInternalFrame的标题栏.

I found some code online, I edited it a bit. I want to hide title bar of a JInternalFrame.

  JInternalFrame frame = new JInternalFrame();
  // Get the title bar and set it to null
  setRootPaneCheckingEnabled(false);
  javax.swing.plaf.InternalFrameUI ifu= frame.getUI();
  ((javax.swing.plaf.basic.BasicInternalFrameUI)ifu).setNorthPane(null);      

  frame.setLocation(i*50+10, i*50+10);
  frame.setSize(200, 150);
  //frame.setBackground(Color.white);      

  frame.setVisible(true);
  desktop.add(frame);

问题是标题栏由于某种原因没有被隐藏. 谢谢.

The problem is that the title bar isn't being hidden for some reason. Thanks.

推荐答案

首先将内部框架转换为basicinternalframe.

First convert the internalframe to basicinternalframe.

这样做:-

BasicInternalFrameUI bi = (BasicInternalFrameUI)your_internalframe_object.getUI();
bi.setNorthPane(null);

此后,标题栏将不可见.

After this your title bar will be invisible.

这篇关于隐藏JInternalFrame的标题栏? -java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆