public class TestWithoutTitlebar extends JFrame {
boolean showTitleBar = false;
...
internalFrame.setUI(new UIframe(internalFrame));
...
// showTitleBar = true;
// internalFrame.revalidate();
...
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
} catch (Exception ex) {
ex.printStackTrace();
}
...
}
class UIframe extends MetalInternalFrameUI {
public UIframe(JInternalFrame internalFrame) {
super(internalFrame);
}
public JComponent getNorthPane() {
return showTitleBar ? super.getNorthPane() : null;
}
}
}