This tip is only for the serious NetBeans geek, but I still found it pretty darn cool if you're working with the NetBeans Lexer (as I am to implement SQL completion in PHP).
If you're wondering how the heck a language's lexer is lexing a source file, you can bring up the token view.
How do you bring this up? It's not available from the Window menu. What you have to do is create a keymap for it, like CTRL-T or Meta-T. You go to Tools->Options (or Netbeans->Preferences on the Mac), select the KeyMap tab, search for "token", and then edit the keymap for "Tokens View" by pressing on the "..." icon under the "Shortcut" column.
Then type in the keystrokes you want to use the token view (I used Meta-T). Close the options dialog, and do your keystrokes, and voila, you get the Tokens View.
Nice! Thanks to Petr Pisl for this tip.