我在网上找到了一些代码,我对其进行了一些编辑。我想隐藏 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);
问题是标题栏由于某种原因没有被隐藏。谢谢。