How to make a window look like this in Java?

friedkiwi picture friedkiwi · Feb 22, 2011 · Viewed 12.6k times · Source

How do I create a window which looks like this in Java:

frame

I want that window layout, instead of the standard Windows-borders, and I don't know how this is called.

Edit: look and feel doesn't work for me:

not working for me

Answer

Joachim Sauer picture Joachim Sauer · Feb 22, 2011

If you want your Look and Feel to draw the window decoration (that's what the "border" is called), then you need to call JFrame.setDefaultLookAndFeelDecorated(true) before creating your JFrame objects and JDialog.setDefaultLookAndFeelDecorated(true) before creating your JDialog objects.