4

I've only found ways to completely remove title bar + borders. I want to create a window in Swing without title bar buttons but still retain the default system's border. Is this possible?

Mintz
  • 929
  • 2
  • 11
  • 17
  • (question isn't nice described) I'm doubt, even could be possible by using some dirty hack, one quite correct way is to change Color to title bar for Substance Look and Feel – mKorbel Dec 08 '12 at 19:05

2 Answers2

9

The following link has a complete working example that uses remove() on the buttons:

http://www.coderanch.com/t/344419/GUI/java/deactivate-close-minimise-resizable-window

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
PeakGen
  • 21,894
  • 86
  • 261
  • 463
  • 2
    I have seen many a complaints about answers with mainly html links (to other sites) that could become dead links please rather post the code here and reference it . but besides that +1 – David Kroukamp Dec 08 '12 at 21:06
4

You can use the frame's setUndecorated() method and render your own decorations. You may want to leverage the JInternalFrame UI defaults, which typically recapitulate those of the platform's default Look & Feel, as shown here. These seem especially relevant:

InternalFrame.activeTitleBackground
InternalFrame.activeTitleForeground
InternalFrame.inactiveTitleBackground
InternalFrame.inactiveTitleForeground
Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045