10 Keyboard Shortcuts That Everyone Should Know

The NetBeans IDE has so many wonderful features that makes a Java developer’s life easier. And many of these features have keyboard shortcuts attached to them. So I decided to make a list of the shortcuts that I think every developer should know.

  • Ctrl+O : Quickly go to a class
    This shows a dialog that allows you to start typing the name of the class that you are looking for. You can then choose the class from a list of matched names.
  • Ctrl+Shift+I : Fix imports
    Add any new imports that are necessary and remove unused ones at the same time. If a class name matches multiple possibilities, a dialog is displayed that allows you to choose which class to import.
  • Alt+Shift+F : Format selection
    Format the selected code according to the rules that can be changed in the IDE Options > Editor > Formatting. This is also a handy way to format XML in a useful way.
  • Alt+F7 : Find usages
    Find where the currently selected type is used.
  • Ctrl+R : Rename
    Rename the selected variable or class, refactoring if required.
  • Alt+Insert : Generate code
    Choose from various context sensitive items that the IDE can generate, for example generating getters and setters.
  • Ctrl+Space : Auto complete
    Context sensitive auto complete.
  • Ctrl+/ : Toggle comment lines
    Adds // to the start of each of the selected lines. Or removes these if present.
  • Ctrl+Shift+Up/Down : Copy lines up/down
    Make a copy of the currently selected lines, without going through the clipboard.
  • Alt+Shift+Up/Down : Move lines up/down
    Move the currently selected lines, without going through the clipboard.

For a much more comprehensive list of keyboard shortcuts, have a look at Highlights of NetBeans IDE 7.4 Keyboard Shortcuts & Code Templates.

Instructional designer, educational technologist and occasional lecturer who loves travel and photography

1 thought on “10 Keyboard Shortcuts That Everyone Should Know”

Leave a Comment