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.

Advertisements

About harryjoy
A passionate self-taught software developer. Currently working as Lead Software Engineer in an IT company.

One Response to Change default title bar in JFrame

  1. Mustafa says:

    Hello we have to import any package for this

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: