Blurry text in a Mac OS X Java Swing application (solution)

I noticed recently that a Scala/Java Swing application I am developing on Mac OS X 10.9 has blurry text when it’s run as a Mac application. The text looks fine when I run the application through SBT, but looks blurry when I package it and run it as a Mac OS X application.

A solution is to put this text in the application’s Info.plist file:

<key>NSHighResolutionCapable</key>
<true/>

I found that solution in a SO thread and in a Java bug related to this issue. The Java bug report says the problem is fixed with the latest Java releases, but the text is still blurry on my Mac OS X 10.9 system running the latest Java 7 version, and when I add this key to the application’s Info.plist file it’s no longer blurry ... that’s all I know at the moment.

Update: The javapackager command seems to add this setting automatically, but if you use the AppBundler, you’ll need to add it to the Info.plist file manually.