Monday, June 9, 2008

Java 5.0 + OSX 10.5 + Netbeans 6.1

It seems OSX 10.5 has issues with JTextBox's created with NetBeans.

And probably others. In short, I just bundled my application with "Quaqua" Look & Feel, and it fixed the NullPointerException's. See Quaqua's page for how to do this (there's some really easy to follow instructions on there).

I'd like to rant that I've found multiple people complaining about the OSX implementation of swing causing NullPointerException's in the EVT (Event Dispatch Thread) of their applications, but mostly with Java 1.3 or Java 1.4, and commonly with the "Save As" dialog. Its a bit embarrassing that Macintosh's Look & Feel is buggier than the Open-Source community supported one, but this isn't the only case where the open-source alternative is much better in the Java world. (

Here's some similar posts:

Why blame Apple?

Since there's no stack-trace to any applications it seems its inherently caused by the OSX LAF (Look & Feel). Here's the error I get...


Experts will argue, a GUI NullPointerException is due to poor threading (when you don't properly use invokeAndWait(), or invokeLater() when updating the GUI) but in this project, I'm using NetBeans to do its own threading (besides, these errors are thrown before any threads are actually started!!!), and in NetBeans defense, it works for Metal L&F, Windows L&F, GTK L&F.

Hope this helps some in their struggles. Post a reply if you've found a non "Quaqua" work-around. :)


No comments: