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

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

3 thoughts on “Changing default Look’n’Feel for Netbeans (and the GUI builder)

  1. avatarMike

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

    Did I say thank you already? If not then thank you!!!! πŸ˜€

    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 πŸ˜€ 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. avatarRaftaMan Post author

    @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 πŸ˜‰

Leave a Reply

Your email address will not be published. Required fields are marked *

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