After installing "Java for Mac OS X 10.5 Update 4" I experienced a lot of trouble with NetBeans, e.g. I could neither create a new project, nor a new Java class in an existing project.
What helped, was using JDK 1.6 instead of JDK 1.5. To do this edit the file netbeans.conf and change apply this change:
#netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home

