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:
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.
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