Reputation: 10996
When I was editing GUI class I've found editor fold.
// <editor-fold defaultstate="collapsed" desc="Generated Code">
...
// </editor-fold>
I've started using it for my own purposes, but it's couple of words to write. So I'm looking for any faster way.
Upvotes: 26
Views: 22933
Reputation: 321
In Netbeans, you can type 'fcom' and press 'TAB'.
More shortcuts here
Upvotes: 32
Reputation: 4491
The previous solutions didn't work for me (maybe because I'm on a mac) so here's how I did it:
// <editor-fold defaultstate="collapsed" desc="$DESCRIPTION$">
$SELECTION$$END$
// </editor-fold>
Upvotes: 12
Reputation: 35374
It is now the default behavior in Netbeans 7.3.1.
Just select the lines and click Surround with ...
as below snapshoot.
Upvotes: 20
Reputation: 10996
I've found it and it's simple :)
http://wiki.netbeans.org/SurroundWithCodeFolding
Upvotes: 11