After starting Netbeans again after a long time on Linux, I’ve found that the font rendering is horrible.
No antialiasing at all!

After some quick research online, I found the answer in the Arch Linux wiki: Netbeans and Java Runtime Environment Fonts which told me that font antialiasing in Java applications is most likely never activated by default and one needs to add the following two parameters to the application’s startup options:

-Dswing.aatext=TRUE -Dawt.useSystemAAFontSettings=on'

This accounts for two of the graphical toolkits of Java: Swing and AWT.

If you are like me and don’t want to add this to each and every application manually, the second wiki article mentions a place to do so globally: /etc/environment. This file - amongst others - is parsed by the PAM module pam_env and sets environment variables globally, which can be used to set _JAVA_OPTIONS, an environment variable that let’s you add options to be passed to the Java interpreter.

I now have the following in my /etc/environment:

_JAVA_OPTIONS='-Dswing.aatext=TRUE -Dawt.useSystemAAFontSettings=on'

Now every Java application that uses Swing or AWT has font antialiasing enabled and looks much, much smoother. I’m happy. 🙂