It’s all very fine and well those Windows people having a nice native Look & Feel under Netbeans, but what about us lowly Linux types? Well as many already know, Sun implemented a GTK Look & Feel around the 1.5 release, but the Metal Look & Feel is still the default on a Linux system, even at 1.6. The new GTK Look & Feel actually uses GTK widgets underneath, so will emulate the GTK Look & Feel very closely (although I’ve come across a few minor issues with scrollbars).
So how do you invoke Netbeans with the GTK Look & Feel? It’s documented in the Netbeans documentation:
Instead of simply invoking the /bin/netbeans executable, invoke:
/opt/netbeans/bin/netbeans -laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Substitue /opt/netbeans for wherever you installed Netbeans to.
Hint: You can open your “/opt/netbeans/etc/netbeans.conf” file, and add the “-laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel” to the end of the “netbeans_default_options” variable.
This is all very fine and well for GNOME people, but what about the KDE users out there? The answer comes in the form of the QT Engine for GTK. It makes GTK applications use QT for their rendering (installed by default in SUSE).
Finally, heres a screen shot of Netbeans running with the Serenity Look & Feel (under KDE). I know it doesn’t look great, but it illustrates the idea anyway ๐ Click the image for the full view.
July 5, 2007 at 1:22 pm
Thanks for those tips. On ubuntu linux, the conf file to edit is:
/etc/netbeans5.5/netbeans.conf
At least for version 5.5. Thanks again!
September 3, 2007 at 8:56 am
Hi
I am Amit, NetBeans Community Docs co-ordinator. Your tip would make a good entry for the NetBeans Community Docs. Would you kindly contribute it there? Or I can do that for you. Just let me know!
Looking forward to hear from you!
Thanks
December 7, 2007 at 10:07 pm
Just downloaded Netbeans 6.0 and it turns out that the look and feel option has been changed from -laf to –laf everything else remains the same.
December 7, 2007 at 10:08 pm
Well the previous post did not work properly ๐
Its laf with a double hyphen (long format notation), so – – laf
August 27, 2008 at 2:05 am
Hi,
Thanks for the tip, it works, but the fonts of the IDE become smaller and without anti-alising, they are very ugly. Any hints to use my default KDE fonts?
September 7, 2008 at 2:45 pm
In netbeans 6.0.1, it’s
--laf
, not-laf
October 7, 2008 at 8:31 pm
For all the Ubuntu people out there, I couldn’t find the conf file anywhere. However, I found a better way to do it.
Right-click on the Applications menu -> Edit Menus.
Find the NetBeans application and right-click on it -> Properties
Replace the Command with this:
/usr/bin/netbeans –laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel
October 7, 2008 at 8:32 pm
For some reason the comment had the extra dash (-) taken out. The “-laf” is supposed to have two dashes in front it, not just one, as others above have mentioned.
October 31, 2008 at 6:20 pm
thanks that helps. for me the look and feel changed from native to the metal when i switched from gnome to xfce on ubuntu but adding the option in conf file fixed it.
November 17, 2008 at 3:41 pm
Thanks, this’s very helpful .
September 4, 2009 at 6:06 am
Hey,
thanks a lot!!
I really hate jdk look of any java applications.
once again thanks.
September 4, 2009 at 6:27 am
I would strongly advise changing your default Look And Feel to Nimbus. Edit (or create) you swing.properties file: <JRE_HOME>/lib/swing.properties
Add the line:
swing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
This will make all your Swing apps look a hell of a lot better. Won’t be native look and feel, but it’s what I’m running and I’m wishing that KDE had a Nimbus LAF ๐
March 25, 2012 at 6:02 pm
[…] You’ll notice NetBeans looks ugly in Xfce (compared to Unity/Ubuntu). To fix that, add –laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel to any and all launchers for NetBeans. For some reason, NetBeans on Unity loads the GTK Look and Feel, whereas under Xfce it loads a “Metal” Look and feel. Solution found here. […]
September 15, 2012 at 8:29 am
Thank you so much.
I have a Dark theme for xfce and didn’t like the metal theme.
This worked for me using 7.2
I added “–laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel” to my netbeans.conf file.
which was located here: /usr/local/netbeans-7.2/etc/netbeans.conf
I added at the end of the netbeans_default_options variable and seperated it with a space before the “–laf”
Your config file location will vary. You can locate it by typing this command in your terminal:
locate netbeans.conf
October 23, 2021 at 7:52 pm
[…] You’ll notice NetBeans looks ugly in Xfce (compared to Unity/Ubuntu). To fix that, add –laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel to any and all launchers for NetBeans. For some reason, NetBeans on Unity loads the GTK Look and Feel, whereas under Xfce it loads a “Metal” Look and feel. Solution found here. […]
March 22, 2022 at 7:52 am
[…] GTK ๋ฃฉ์คํ์๋ก๋ํ๋ ๋ฐ๋ฉด Xfce์์๋ “๋ฉํ”๋ฃฉ์คํ์๋ก๋ํฉ๋๋ค. ํด๊ฒฐ์ฑ ์ ์ฌ๊ธฐ์ ์์ต๋๋ค […]