// no title bar, no borders, no buttons, not resizable.
JWindow j = new JWindow();

// plain title bar. Just a close button, resizable.
JDialog d = new JDialog();

// plain three large native GUI buttons, can be moved and resized.
// like setUndecorated( false )
JFrame f = new JFrame();

// no title bar, no borders, not resizable. like JWindow.
f.setUndecorated( true );

// green title bar, no buttons, can be moved and resized.
f.setUndecorated( true );
f.getRootPane().setWindowDecorationStyle( JRootPane. COLOR_CHOOSER_DIALOG );

// green title bar, no buttons, can be moved and resized.
f.setUndecorated( true );
f.getRootPane().setWindowDecorationStyle( JRootPane. QUESTION_DIALOG );

// blue title bar, no buttons, can be moved and resized.
f.setUndecorated( true );
f.getRootPane().setWindowDecorationStyle( JRootPane. PLAIN_DIALOG );

// blue title bar, no buttons, can be moved and resized.
f.setUndecorated( true );
f.getRootPane().setWindowDecorationStyle( JRootPane. INFORMATION_DIALOG );

// orange title bar, no buttons, can bo moved and resized.
f.setUndecorated( true );
f.getRootPane().setWindowDecorationStyle( JRootPane. WARNING_DIALOG );

// pink title bar, no buttons, can bo moved and resized.
f.setUndecorated( true );
f.getRootPane().setWindowDecorationStyle( JRootPane. ERROR_DIALOG );

// plain three large native GUI buttons, can be moved and resized.
f.setUndecorated ( false );

// blue title bar, 3 intricate buttons, can be moved and resized.
f.setUndecorated( true );
f.getRootPane().setWindowDecorationStyle( JRootPane. FRAME );

// Static method that causes all subsequently created JFames
// to have blue title bars with 3 intricate buttons that
// can be moved and resized.
JFrame.setDefaultLookAndFeelDecorated( true );

// No effect on appearance, prevents user from changing size.
// and close. Can still minimize.
// May be combined with setWindowDecorationStyle.
f.setResizable( false );

// Note the setWindowDerocationStyle
// but missing the setUndecorated( true ).
// Produces goofy double frame, frame within a frame. Two title bars.
f.getRootPane().setWindowDecorationStyle( JRootPane. WARNING_DIALOG );