Change default title bar in JFrame

This blog contains information about how to change the default boring title bar 
of a Java Swing Application and make your application look something like this:

Midnight Look And Feel JFrame

The magic is done by following 2 lines:
       jframe.setUndecorated(true);
       jframe.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);

After adding this 2 lines your jframe will look like:

This will still work same as title bar but now when you apply any of your look and 
feel it will become like the first image. Not the exact copy because your look and 
feel will be different from the one (Midnight Skin Look And Feel) used to take the 
first picture.

Advertisement

One thought on “Change default title bar in JFrame

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.