When opening Netbeans via Docky you click the launcher and it opens a separate program in the Docky menu.
To fix this we need to add :
to the netbeans.desktop file.
This has fixed the issue on my Docky instance running Ubuntu 10.04 ( Lucid )
It's not a must have but would be a welcome addition so as not to have to hack again.
https://bugs.launchpad.net/docky/+bug/484610 - Is where I found the original bug relating to Docky and the fix