Java Editor Shortcuts

See Also

There are keyboard shortcuts available to activate the following Java Source Editor operations:

Keys Action
Ctrl-Shift-B Goes to the source of the item the insertion point is on.
Ctrl-B Goes to the method or variable declaration for method or variable the insertion point is on.
Ctrl-Q Goes to the line in the file where the last change took place.
Ctrl-/ Comments/uncomments the current line or selected lines.
Alt-Shift-F Formats the selected code or the entire file if nothing is selected.
Alt-Shift-Left Moves the selected line or lines one tab to the left.
Alt-Shift-Right Moves the selected line or lines one tab to the right.
Alt-Shift-Up Moves the selected line or lines one line up.
Alt-Shift-Down Moves the selected line or lines one line down.
Ctrl-Shift-Up Copies the selected line or lines one line up.
Ctrl-Shift-Down Copies the selected line or lines one line down.
Ctrl-Slash Toggles the commenting out of the current line or selected lines.
Ctrl-Space Shows code completion box.
Alt-Insert Pops up a context aware menu that you can use to generate common structures such as constructors, getters, and setters.
Alt-Enter Displays editor hints. The IDE informs you when a hint is available when the lightbulb is displayed.
Alt-Shift-I Generates the import statements required by all classes specified in the file.
Ctrl-Shift-I Generates the import statements required by the class under the cursor.
Ctrl-P Selects the next parameter. You must have a parameter selected (highlighted) for this shortcut to work.
Ctrl-Shift-Space Shows documentation for item under the cursor.
Ctrl-Shift-K Generates the next word used elsewhere in your code as you type its beginning characters.
Ctrl-K Generates the previous word used elsewhere in your code as you type its beginning characters.
Ctrl-R Inplace rename.
See Also
General Editor Shortcuts
Setting Keyboard Shortcuts
Menu Shortcuts
Help Viewer Shortcuts
Window Navigation Shortcuts

Legal Notices