It took me a while but I solved it like this:
In NetBeans, open the Java Platform Manager (Tools -> Java Platforms).
Click the Add Platform... button in the lower left corner.
Select Java Standard Edition (selected by default).
In the File field, enter: /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home
Click Next >
The Platform Sources field should say: /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home/src.jar
If the Platform Javadoc field is empty, browse to or enter: /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home/docs.jar
Click Finish
Exit NetBeans.
Open: /Applications/NetBeans/NetBeans 6.8.app/Contents/Resources/NetBeans/etc/netbeans.conf (e.g. in TextEdit)
Beneath the line that says: #netbeans_jdkhome="/path/to/jdk"
Enter: netbeans_jdkhome="/Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home"
Overriding the default location in the netbeans.conf file may be enough such that you don't need to add the platform in the Netbeans Java Platform Manager.