NetBeans Cheetsheet

This is a list of some facilities the current NetBeans editor offers, that help me reduce the number of keystrokes I have to do when typing code. Basically it consists of my favorite abbreviations that generate code from templates, plus some shortcuts to commands and actions available in the source editor. Some of these abbreviations and shortcuts are ubiquitous in contemporary java IDEs and some are specific to NetBeans.

These type of tools along with some macros that suit your specific needs (either from within NetBeans or from an external macro utility), can speedup the task of getting the stuff from your head to the computer. Usually I have a bunch of cheetsheets printed on small pieces of paper and pinned on the frame of my monitor so there are available whenever I need them with out having to loose focus from the window I’m working on.


dowhile do {} while (condition);
forc for (Iterator it = collection.iterator(); it.hasNext();) {Object elem = (Object);
ifelse if (condition) {} else {}
sout System.out.println(“|”)
trycatch try {} catch (Exception e) {}
!cd <![CDATA[|]]>


Ctrl-G Jumps to any specified line.
Ctrl-Minus (-) Collapses the block of code the instertion point is on.
Ctrl-Plus (+) Expands the block of code the instertion point is next to.
Ctrl-E Deletes the current line.
Ctrl-Shift-T Comments out the current line or selected lines.
Ctrl-Shift-D Removes comment from the current line or selected lines.
Ctrl-F2 Sets or unsets a bookmark at current line.
F2 Goes to next bookmark.

Social Bookmarks:


2 thoughts on “NetBeans Cheetsheet

  1. I use netbeans shortcuts 1000 times per day.
    My favourite abbreviations are:

    And my favourite shortcuts are:
    alt+shift+e (jumps from class to unit test and vice versa)
    ctrl+shift+u (creates unit test for class)
    ctrl+shift+1 (takes me to project nav with file selected)
    ctrl+f3 (marks current word and searches)
    and of course: alt+shift+o (goes to class)

    I can’t wait for NetBeans 6 GA.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s