Home > Uncategorized > Changing default Look’n'Feel for Netbeans (and the GUI builder)

Changing default Look’n'Feel for Netbeans (and the GUI builder)

November 6th, 2009 Leave a comment Go to comments

Netbeans’ GUI builder is great. It’s one of the essential features that made me drop eclipse.

But designing accurate GUIs can be a pain in the arse. Especially, when you use the GUI builder with a certain preview Look and Feel (e.g. GTK+) but you application later runs with a completely different L’n'F (e.g. Nimbus). It’s almost certain, that your design will look rather ugly. Unless you want to design your GUI manually (which isn’t a bad idea, btw.), you have to make sure, your design preview and application match.

While changing the L’n'F in your application is quite simple, changing Netbeans’ L’n'F (and therefore the GUI builder’s L’n'F ) is rather tricky. The easiest way is probaly the --laf flag:

$ netbeans --laf Nimbus

If you want to start Netbeans in Nimbus-mode per default, just add --laf Nimbus to netbeans_default_options in ~/.netbeans/6.5/etc/netbeans.conf.

If the file doesn’t yet exists

mkdir -p ~/.netbeans/6.5/etc/ 
echo netbeans_default_options=\"--laf Nimbus\" >> ~/.netbeans/6.5/etc/netbeans.conf

flattr this!

(1 votes, average: 5.00 out of 5)
Categories: Uncategorized Tags: ,
  1. avatar
    Mike
    May 3rd, 2010 at 02:51 | #1

    Thank you thank you thank you thank you and thank you.

    Did I say thank you already? If not then thank you!!!! :D

    Seriously I had been pulling my hair out four hours trying to work this out… (I am bald as it is… so that is saying something).

    You have quite simply made my day :D Incredible. I googled for over an hour… it is sometimes really hard to get the right search result in google where certain keywords are overloaded or ubiquitous or both. I am normally pretty good at searching… I tried other combinations but the only search result which got something useful was:

    “gui builder design in nimbus netbeans” minus quotes. Ah well lol… I live and learn ;)

    Have a good day sir!

  2. May 6th, 2010 at 16:51 | #2

    @Mike No need to thank me. That’s what this blog is here for… But it’s always nice to read some friendly comments. Keeps me going ;)

  3. February 20th, 2013 at 15:00 | #3

    Thank you! useful and easy to apply

  1. No trackbacks yet.