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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…