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

Fix for Google Chrome crash after startup

The issue with Google Chrome was that it crashed in about 3 seconds after startup. I encountered this problem using Chrome 9 and 10 beta on Ubuntu 10.10, but this fix may apply to other versions and operating systems as well.

I’ve tracked the problem as being related with the account (data) synchronization. After disconnecting my internet connection it did not crashed anymore, so I went to the Preferences page (Wrench -> Preferences -> Personal Stuff) and stopped the account synchronization. Then closed Chrome, restored the Internet connection, restarted Chrome and everything went OK.

Trying to re-enable the account synchronization just caused another crash, thus this is definitely the cause of my Chrome problems. Strangely I was able to re-enable the sync after several days, but the problem also re-appeared after restarting Chrome.

Midnight Commander preserve saved settings

In Ubuntu 9.10 (Karmic Koala), Midnight Commander, one of the most used CLI file managers available for Linux is unable to preserve settings over different sessions.

The solution is quite simple: in order to save it’s settings, Midnight Commander requires a “.mc” folder (notice the dot – it means it is a hidden folder) to be created in your user’s home directory. Just create the “.mc” directory, go and change the default settings to your favourite ones and Midnight Commander should create proper configuration files required to keep “mc” settings over different sessions.

Enable compositing effects for metacity in Ubuntu

Desktop effects in Ubuntu can be used without Compiz, by enabling compositing in Metacity – the Gnome’s default window manager.

There are more ways to enable compositing in Metacity, but first you need to disable Compiz if you are using it. The fastest way is to go to System->Preferences->Appearance, select the Visual Effects tab, then check the radio button None.

  • CLI way to enable compositing effects: open a terminal and type:
gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool true
  • GUI way to enable compositing effects: open the Configuration Editor (gconf-editor), go to apps->metacity->general and enable the checkbox compositing_manager.

Although  Metacity is much smoother, the effects are minimal – just some shadows on windows and menus, windows preview for Alt+Tab.