Fix NetBeans big fonts on Ubuntu

There is a rather annoying issue related with NetBeans displaying large fonts on Ubuntu for menus and panels. There are some suggestions on Ubuntu forums related with java fonts settings, but there are a couple of better solutions which may improve the way NetBeans looks on Ubuntu when it comes to font size.

The default Netbeans look and feel on Ubuntu looks like this:

NetBeans default look and Feel on Ubuntu

The integration with the default theme is great, except for the large fonts.

Lower the application font

The first solution consist in lowering the font used for applications. By default Ubuntu is using for applications the Ubuntu font family with a size of 11. Go to the “Fonts” tab on “Appearance Preferences” window (right-click on Desktop, select “Change Desktop Background”) and set the “Application” font (highlighted in below image) to 10.

Appearance Preferences

The fonts should be better now in NetBeans, but the downside is that all your applications’ fonts will be smaller. If you can live with that, great! If not, here goes another solution.

Use the Nimbus look and feel

The second solution is using the java Nimbus look and feel. Nimbus may be best described as a skin for java applications, thus this tip applies not only to NetBeans, but to other java applications as well.

In order to specify the look and feel, edit the “netbeans.conf” file (usually the file is placed in “<netbeans_installation_directory>/etc/”), find the “netbeans_default_options” option and insert the following values right before the last quote:

 --laf Nimbus -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd

With the Nimbus skin, Netbeans should look likw this:

Nimbus look and feel tip thanks to Geertjan’s Blog

9 thoughts on “Fix NetBeans big fonts on Ubuntu”

  1. The above solution doesn’t work under Ubuntu 11.10 for some reason. While the size of the font is changed, it’s the menu items that aren’t highlighted that look terrible.

  2. I had to (on Ubuntu 11.04) reduce the font size to 9 to get nice font results. Note that I had to restart netbeans to make font changes take effect, unlike for other applications.

    Also tried to “Nimbus look and feel”, yikes!

  3. Indeed, reducing the font size might be a better alternative than using “Nimbus”, but on smaller screens (even 15″) smaller fonts are hard to read.

    Since I don’t like Unity or Gnome3, I’m using Xfce now and for some reason I no longer have the fonts issue on Xubuntu 11.10.

  4. Netbeans does not have something like “look and feel”. It has only more or less of “ugliness”. Stupid shit.

    Fortunately, Nimbus trick works. I have tried thousands of tweaks. Prick, who created Netbeans installer and config for linux, should be stabbed in both eyes with heavy camping equipment.

Leave a Reply