The last few days, I have been struggling while writing code in NetBeans, because auto-indent just disappeared. I asked for help on the nbusers list but didn't see an answer.
While walking my kid in the stroller this morning, I had a moment of illumination. When I came into work, I removed my userdir, and that fixed the problem. Magic!
Actually, removing your userdir seems to be the Magic Bullet for strange NetBeans behavior. NetBeans seems to be able to get its configuration repository mixed up from time to time, and then it starts having these little psychotic episodes like no longer indenting, or badging files that compile fine, and so on.
So, what is this "userdir" of which I speak? It's the "user directory" and it contains all the configuration environment for NetBeans for a given user. And where is this beast? Take a look at this FAQ for your answers (note that on a Mac the "About" page is not under "Help" but under the bold "NetBeans" menu on the far left).
Be aware that when you remove your userdir, you lose any configurations you have set up. You will have to re-register your app server, re-install any extra modules you installed, and so on. Perhaps there is a way to avoid this consequence, but I haven't spent the time to track it down.