How to change look and feel of NetBeans

If you want a different appearance of NetBeans than it is the native one you can simple change the look and feel (L&F). There can be also another reason for changing look and feel due to a bug in Windows L&F. When you are on Windows machine and you use the native Windows look and feel you can run into a problem with focus. Switching between NetBeans IDE and for example Firefox using Alt+TAB and sometimes when switching back to the IDE instead of being focused in the editor where you left it, the menu is focused instead. 

Some  L&Fs are available in Sun Java and many L&Fs are available on internet. Using L&Fs that are in Sun JDK is simple. You should know which Java you use and which version. For example Nimbus L&F is available from Sun JDK 1.6. You can run NetBeans with this L&F in two ways. The first one is running NetBeans from command line with --laf option. This way is sufficient, if you want to just try a L&F. So on \*nix OS it's :

/path_where_netbans_are_installed/bin/netbeans --laf com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

The second way is put the --laf option to the netbeans.conf file. The netbeans.conf file is located in etc folder in NetBeans installation folder. Open the netbeans.conf file and add the option into netbeans_default_options. When you do it in this way, then it's permanent and NetBeans will always start with this L&F.

There are a few screenshots of NetBeans with some L&F, which are available in Sun JDK 1.6.

Nimbus: --laf com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

Metal: --laf javax.swing.plaf.metal.MetalLookAndFeel

GTK: --laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel

As I wrote above, we are not limited only with L&Fs, which are available in a JDK. You can dowload different L&Fs from net. Some of them are open source and free, but there are also commercial. If you want to use such L&F, you have to download a jar that contains the L&F definition and put it on NetBeans classpath. When you want to try a L&F on the command line, then you run NetBeans also with -cp:p path_to_L&F_jar option, which adds the jar on the NetBeans classpath. For example the command for using Liquid L&F will be:

/path_where_netbans_are_installed/bin/netbeans --laf com.birosoft.liquid.LiquidLookAndFeel -cp:p /path/to/liquidlnf.jar

You can put both options into default netbeans_default_options in netbeans.conf file, if you want to use command line.

There are a few examples. You can download the jar from the projects page and play with them.

Liquid: --laf com.birosoft.liquid.LiquidLookAndFeel -cp:p /path/to/liquidlnf.jar

Napkin: --laf net.sourceforge.napkinlaf.NapkinLookAndFeel -cp:p /path/to/napkinlaf.jar

NimROD: --laf com.nilo.plaf.nimrod.NimRODLookAndFeel -cp:p /path/to/nimrodlf.jar

Quaqua: --laf ch.randelshofer.quaqua.QuaquaLookAndFeel -cp:p /path/to/quaqua.jar

If you find a nice L&F, write me, I will add the screenshot here.

Comments:

Thanks for the post!

Posted by Amit on December 03, 2008 at 04:37 AM CET #

HALLELUJAH!!!!

You just solved issue #1 of 2 MAJOR issues for me.

If you can tell me how to get the double-click for selecting a word to work on Mouse-Down as opposed to Mouse-Up, you'll officially have made my life a WHOLE lot easier and more enjoyable (with regards to NetBeans of course).

Posted by James on December 03, 2008 at 06:24 AM CET #

If think is so complicate to remember com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel you can put the shortcut "Nimbus", like this: netbeans --laf Nimbus

Source: http://blogs.sun.com/coreqa/entry/short_look_feel_switches_for

Posted by Giuliano on December 03, 2008 at 06:34 AM CET #

I always ask myself: "Is it so difficult to put an option in the "option menu"??" Simple drop down menu - nothing fancy.

Posted by Daniel Dimitrov on December 03, 2008 at 06:48 AM CET #

Hi Petr,

\*THANKS\* for this tip. I really do not like the L&F of the Mac OS version (default Quaqua), so I now know how to switch it to MetalLookAndFeel, which so much better for me.

Posted by Jan Brucek on December 03, 2008 at 06:49 AM CET #

I second @James comment, the focus issue was killing me, the Metal l&f is much better. Word select on dbl-click-mouseup is a pita too though, it needs to be on dbl-click-mousedown. Searching netbeans suggests DefaultEditorKit.java is responsible - any Swing gurus have a suggestion?

Posted by Demian Turner on December 03, 2008 at 08:23 AM CET #

To James: Regarding the doubleclick - the current behavior is unfortunately hardcoded. So I entered new issue http://www.netbeans.org/issues/show_bug.cgi?id=154505 . Feel free to add your comment there and I hope that it will be fixed soon.

To Daniel: There was such option in the ui for selecting L&F, but it was few years ago. NetBeans are not simple Swing application and it uses some costume components, which doesn't have to work with some L&F correctly. Probably the reason for removing the option as well was, that is not possible to provide preview without restarting. And the last think is, how often do you change it?

Regards,
Petr

Posted by Petr on December 03, 2008 at 09:37 AM CET #

thank for the info,

any chance windows L&F focus bug will be fixed ?

regard

Anton

Posted by Anton Heryanto on December 03, 2008 at 10:25 AM CET #

Hi Anton,

the Windows L&F is in JDK and it looks like it has long history. I don't have idea, when it can be fixed. When I went through the bug reports, then I had feeling, that it was already fixed, but after a while it appears again.

Regards,
Petr

Posted by Petr on December 03, 2008 at 11:00 AM CET #

One on the most attractive for me is Substance Look & Feel...

https://substance.dev.java.net/see.html

Posted by Martin Skurla on December 03, 2008 at 11:18 AM CET #

Thanks for logging the ticket Petr. I would LOVE for this "issue" to be resolved.

Posted by James on December 03, 2008 at 05:22 PM CET #

Thank Petr for this info.
I'm using Windows, and this tips really helps.

Posted by Yudi Setiawan on December 03, 2008 at 08:42 PM CET #

Hi All:

I am trying to change the skin of my NB6.5.

This is my environment on ubuntu 8.1
java -version
java version "1.6.0_0"
IcedTea6 1.3.1 (6b12-0ubuntu6) Runtime Environment (build 1.6.0_0-b12)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b12, mixed mode)

If I try to run /usr/local/netbean6.5/bin/netbean --laf com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

I get "uI class not found, using default UI..."

1. Where can I download some of these themes mentioned above?
2. Do they work with OpenJDK or I need to switch to SUNJDK ?

Posted by Toma on December 08, 2008 at 06:38 PM CET #

Hi Toma,

I was writing about SUN JDK. For Nimbus theme I should install SUN JDK 1.6.0_10, which is update 10.

Regards,
Petr

Posted by Petr on December 09, 2008 at 02:21 AM CET #

Hi Petr:

I am still trying to change L&F of netbean without any success.

tom@sony:~$ java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)

I switched to sun JDK on my Ubuntu 8.1 64bit: As u can see above. Using the command line you mentioned above I get the following output

./netbeans --laf com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
UI class not found, using default UI...
UI class not found, using default UI...
/usr/share/themes/EdubuntuColors/gtk-2.0/gtkrc:77: Murrine configuration option "hilight_ratio" will be deprecated in future releases. Please update this theme to get rid of this warning.

Any ideas guys ? Sorry if this is not the place to ask this question.

Posted by Toma on December 11, 2008 at 12:39 AM CET #

Hi Petr:

BY the way, latest build of NB from trunk with Nimbus worked on the same configuration as i reported on previous post. I am happy with result, so no worries about 6.5FCS, Nightly builds are good enough for me.

Regards

Posted by Toma on December 11, 2008 at 02:43 AM CET #

To Toma,

this is strange. It should work for NB 6.5 as well.

I have Ubuntu as well and my current version of java is:

Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25)
Java HotSpot(TM) Server VM (build 11.0-b12, mixed mode)

Petr

Posted by Petr on December 11, 2008 at 03:23 PM CET #

Nice post! Thanks!

Posted by eldo on December 15, 2008 at 02:36 PM CET #

Thank You

Posted by Emo Resimleri on May 01, 2009 at 10:59 AM CEST #

the Windows L&F is in JDK and it looks like it has long history. I don't have idea, when it can be fixed. When I went through the bug reports, then I had feeling, that it was already fixed, but after a while it appears again.

Posted by dvd film izle on June 09, 2009 at 12:15 PM CEST #

I always ask myself: "Is it so difficult to put an option in the "option menu"??" Simple drop down menu - nothing fancy.

Posted by Funs blog on January 24, 2010 at 11:21 PM CET #

Hi, nice to know this.
While I prefer native L&F (I develop for Windows users, so they are not used to "weird" L&F), I would like to hear someon's experience related to performance and L&F. Should native L&F be faster than custom? Is there any overhead by choosing a custom L&F?

Thanks all

Posted by Alied Pérez Martínez on May 04, 2010 at 04:11 PM CEST #

it needs to be on dbl-click-mousedown. Searching netbeans suggests DefaultEditorKit.java is responsible - any Swing gurus have a suggestion?

Posted by earth4energy on August 28, 2010 at 07:36 AM CEST #

hello i have downloaded a new theme named synthetica and now i want to add theat in my project. its so urgent.please tell me how to add this theme in jdk1.6
thank you!
(i dont use netbean or any other kind of softwares)

Posted by jai on October 09, 2010 at 06:07 AM CEST #

[Trackback] Hey folks, It’s weekend, so there’s time for own projects and if you do like me, you already programmed the first five days before weekend. So its time for a variety! While I clicked through the NetBeans wiki (Do you know that NetBeans 7 wi...

Posted by First steps of a shiny CodeStar on January 29, 2011 at 05:45 AM CET #

[Trackback] Hey folks, It’s weekend, so there’s time for own projects and if you do like me, you already programmed the first five days before weekend. So its time for a variety! While I clicked through the NetBeans wiki (Do you know that NetBeans 7 wi...

Posted by First steps of a shiny CodeStar on January 29, 2011 at 05:47 AM CET #

Thank you very much for this post. I just love the native look and feel of Java rather than the one included in netbeans default.

Posted by tony on September 03, 2011 at 12:22 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today