NetBeans IDE is the free, open-source development environment from the Apache Software Foundation for Java, PHP, C and C++, HTML5 and JavaScript. It is a full IDE: a smart source editor, a debugger, a profiler, version control, a GUI builder and project management, all in one download, and it costs nothing for commercial or non-commercial use under the Apache License 2.0.
This complete list explains every shortcut in plain words, so you know not just which keys to press but what each one actually does. Every shortcut here was checked against the official NetBeans documentation and the official NetBeans keyboard shortcuts card. Windows and Linux share the same default keymap, while macOS has its own mapping, so this post gives both keys for every shortcut. The current release is Apache NetBeans 32, released on 16 November 2026. On a Mac, Command usually takes the place of Ctrl and Control takes the place of Alt, with a few exceptions.
How to Use NetBeans Shortcuts
Three shortcuts unlock almost everything in NetBeans. Press Alt plus Enter on any error or warning to open the hints menu, which offers quick-fixes and, for a block of code, the Surround With options. Press Control plus Space for code completion, which suggests class names, methods and variables as you type. Press Alt plus Shift plus F to format the file, which fixes the indentation of the whole file at once.
Second, NetBeans shows you the shortcut for a command in two places: the menu item itself, and the full list under Help, then Keyboard Shortcuts Card, which opens the official card inside the IDE. Third, the editor toolbar has buttons for the shortcuts people use most, such as Last Edit, Back, Forward and Toggle Bookmark, so you can learn a key by watching its button.
Top NetBeans Shortcuts
These are the shortcuts NetBeans developers reach for most often.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| Ctrl + Space | Ctrl + Space | Complete Code: show the code completion box with suggestions at the caret |
| Alt + Enter | Ctrl + Enter | Show Hints / Fix Code: show quick-fixes for an error and intention actions, including Surround With |
| Ctrl + B | Command + B | Go to Declaration: jump to the declaration of the item under the cursor |
| Alt + Shift + F | Ctrl + Shift + F | Format: format the selected code, or the whole file if nothing is selected |
| Ctrl + Shift + I | Command + Shift + I | Fix Imports: generate the import statements the classes in the file need |
| Ctrl + O | Command + O | Go to Type: find and open a specific class or interface |
| Alt + Shift + O | Ctrl + Shift + O | Go to File: find and open a specific file |
| Ctrl + G | Ctrl + G | Go to Line: jump to a line number you type |
File Menu Shortcuts
File shortcuts create, open, save and print. Control plus Shift plus N starts a new project, and Control plus N starts a new file inside the current project.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| Ctrl + Shift + N | Command + Shift + N | New Project: create a new project with the New Project wizard |
| Ctrl + N | Command + N | New File: create a new file with the New File wizard |
| Ctrl + Shift + O | Command + Shift + O | Open Project: open an existing project |
| Ctrl + S | Command + S | Save: save the current file |
| Ctrl + Shift + S | Command + Shift + S | Save All: save every open file |
| Ctrl + Alt + Shift + P | Command + Option + Shift + P | Print: print the current file |
| F1 | F1 | Help: show the help topic for the current user interface element |
| Shift + F1 | Shift + F1 | Javadoc Index Search: search the Javadoc index |
Basic Editing Shortcuts
Basic editing shortcuts cut, copy, paste, undo and redo. NetBeans also has two unusual ones worth learning: Control plus E deletes the whole current line, and Control plus Shift plus D opens the clipboard history, so you can paste something you copied several steps ago.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| Ctrl + Z | Command + Z | Undo: reverse the last editor action, except Save |
| Ctrl + Y | Command + Y | Redo: reverse an Undo command |
| Ctrl + X | Command + X | Cut: cut the current selection to the clipboard |
| Ctrl + C | Command + C | Copy: copy the current selection to the clipboard |
| Ctrl + V | Command + V | Paste: paste the contents of the clipboard at the insertion point |
| Ctrl + Shift + V | Command + Shift + V | Paste Formatted: paste the formatted contents of the clipboard |
| Ctrl + A | Command + A | Select All: select everything in the current document or window |
| Alt + Shift + J | Ctrl + Shift + J | Select Identifier: select the current identifier |
| Ctrl + E | Command + E | Delete Current Line: delete the whole line the caret is on |
| Ctrl + Shift + D | Command + Shift + D | Show Clipboard History: pick an earlier clipboard entry to paste |
| Ctrl + U, then U | Ctrl + U, then U | Convert Selection to Uppercase: change the selected text to capital letters |
| Ctrl + U, then L | Ctrl + U, then L | Convert Selection to Lowercase: change the selected text to small letters |
| Ctrl + U, then S | Ctrl + U, then S | Toggle Case of Selection: swap the capital and small letters in the selection |
Find and Replace Shortcuts
Find shortcuts search inside one file or across the whole project. F3 finds the next match, Shift plus F3 finds the previous one, and Control plus Shift plus F searches every project file at once.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| Ctrl + F | Command + F | Find: find text in the current file |
| Ctrl + H | Command + R | Replace: find a string of text and replace it with another string |
| F3 | Command + G | Find Next: find the next instance of the found text |
| Shift + F3 | Command + Shift + G | Find Previous: find the previous instance of the found text |
| Ctrl + F3 | Command + F3 | Find Selection: find instances of the word at the insertion point |
| Ctrl + K | Command + K | Insert Next Matching Word: complete the word you are typing with the next matching word in the file |
| Ctrl + Shift + K | Command + Shift + K | Insert Previous Matching Word: complete the word you are typing with the previous matching word in the file |
| Ctrl + Shift + F | Command + Shift + F | Find in Projects: find text, object names or object types within projects |
| Ctrl + Shift + H | Command + Shift + H | Replace in Projects: replace text, object names or object types within projects |
| Alt + F7 | Ctrl + F7 | Find Usages: find usages and subtypes of the selected code |
| Alt + Shift + U | Ctrl + Shift + U | Find Usages Results: show the results of a Find Usages search |
| Alt + Shift + H | Ctrl + Shift + H | Turn Off Search Result Highlights: switch the highlighting of search text off or on |
Navigate in Source Code Shortcuts
Navigation shortcuts jump around the code without the mouse: to a declaration, to a test, to the last place you edited, and between bookmarks for lines you keep returning to.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| Ctrl + Shift + B | Command + Shift + B | Go to Source: show the source file containing the definition of the selected class |
| Ctrl + Shift + P | Command + Shift + P | Go to Super Implementation: jump to the super implementation of the item under the cursor |
| Ctrl + Shift + T | Command + Shift + T | Go to Test: find and open the test for the current class |
| Ctrl + Q | Command + Q | Last Edit Location: scroll the editor to the last place where editing occurred |
| Alt + Left | Command + Left | Back: navigate back to the previously opened document |
| Alt + Right | Command + Right | Forward: navigate forward to the next opened document |
| Ctrl + Shift + M | Command + Shift + M | Toggle Bookmark: set or remove a bookmark on the current line |
| Ctrl + Shift + Period | Command + Shift + Period | Next Bookmark: cycle forward through the bookmarks |
| Ctrl + Shift + Comma | Command + Shift + Comma | Previous Bookmark: cycle backwards through the bookmarks |
| Ctrl + Period | Ctrl + Period | Next Error: scroll the editor to the line with the next build error |
| Ctrl + Comma | Ctrl + Comma | Previous Error: scroll the editor to the line with the previous build error |
| Ctrl + F12 | Command + F12 | Member Hierarchy: open the member hierarchy of the current class |
| Alt + F12 | Ctrl + F12 | Type Hierarchy: open the type hierarchy of the current class |
| Alt + Shift + F12 | Ctrl + Shift + F12 | Inspect Hierarchy: inspect the code hierarchy of the current class |
| Ctrl + Shift + 1 / 2 / 3 | Command + Shift + 1 / 2 / 3 | Select in Projects / Files / Favorites: show the current file in the Projects, Files or Favorites window |
| Alt + Shift + L | Ctrl + Shift + L | Copy File Path: copy the path of the current file |
Code Editing and Completion Shortcuts
Code editing shortcuts generate code, move lines, comment lines and fold blocks. Alt plus Insert opens the Generate menu for constructors, getters and setters; Alt plus Shift plus Up or Down moves lines, while Control plus Shift plus Up or Down copies them instead.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| Ctrl + Shift + Space | Command + Shift + Space | Show Documentation: show the documentation for the item under the cursor |
| Ctrl + P | Command + P | Show Method Parameters: show the parameters of the method at the caret |
| Alt + Insert | Command + N | Insert Code: open the Generate menu for constructors, getters, setters and other code |
| Ctrl + / or Ctrl + Shift + C | Command + / or Command + Shift + C | Toggle Comment: comment or uncomment the current line or selected lines |
| Alt + Shift + I | Ctrl + Shift + I | Fix Selected Class Import: generate the import statement for the class at the caret |
| Alt + Shift + Left | Ctrl + Shift + Left | Shift Line Left: move the selected line or lines one tab to the left |
| Alt + Shift + Right | Ctrl + Shift + Right | Shift Line Right: move the selected line or lines one tab to the right |
| Alt + Shift + Up | Ctrl + Shift + Up | Move Line Up: move the selected line or lines one line up |
| Alt + Shift + Down | Ctrl + Shift + Down | Move Line Down: move the selected line or lines one line down |
| Ctrl + Shift + Up | Alt + Shift + Up | Copy Lines Up: copy the selected line or lines one line up |
| Ctrl + Shift + Down | Alt + Shift + Down | Copy Lines Down: copy the selected line or lines one line down |
| Ctrl + Shift + R | Command + Shift + R | Toggle Rectangular Selection: switch rectangular block selection off or on |
| Ctrl + Minus / Ctrl + Plus | Command + Minus / Command + Plus | Collapse / Expand Fold: fold or unfold the code block at the insertion point |
Refactoring Shortcuts
Refactoring changes the structure of code without changing what it does. NetBeans keeps this group small: rename, move and safely delete, all in place. For the other refactorings, such as extracting a method or a variable, use the Alt plus Enter hints menu on the selected code, which offers them when they apply. Note that Control plus Shift plus M is Toggle Bookmark in NetBeans, not Extract Method as some old cheat sheets claim.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| Ctrl + R | Ctrl + R | Rename: rename the symbol at the caret in place, everywhere it is used |
| Ctrl + M | Ctrl + M | Move: move the symbol at the caret in place |
| Alt + Delete | Ctrl + Delete | Safely Delete: check the references to a symbol before deleting it |
Build, Run and Test Shortcuts
Build shortcuts compile and run the project. F11 builds the main project, Shift plus F11 cleans and builds it from scratch, and F6 runs it. Control plus F6 runs the unit test for the current file.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| F9 | F9 | Compile File: compile the current file, or only the changed files in a folder |
| F11 | F11 | Build Main Project: build the main project, or the selected project if no main project is set |
| Shift + F11 | Shift + F11 | Clean and Build Main Project: delete all previously compiled files and outputs, then build the project |
| F6 | F6 | Run Main Project: run the main project, or the selected project if no main project is set |
| Shift + F6 | Shift + F6 | Run File: run the currently selected file |
| Ctrl + F6 | Ctrl + F6 | Test File: start the unit test for the current file |
| Alt + F6 | Alt + F6 | Test Project: start the unit test for the project |
| Ctrl + F11 | Ctrl + F11 | Repeat Build / Run: build or run the selected project once again |
| Ctrl + Shift + U | Command + Shift + U | Create Unit Test: create a unit test for the current class |
| Alt + F9 | Alt + F9 | Check File: check the file dependencies in the current project when building |
| Alt + Shift + F9 | Alt + Shift + F9 | Validate File: validate the file dependencies in the current project when building |
Debugging Shortcuts
Debugging shortcuts start a debugging session and step through code line by line. Control plus F5 debugs the main project, F5 continues a paused program, F7 steps into a method call, F8 steps over it, and Control plus F7 steps out of it.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| Ctrl + F5 | Ctrl + F5 | Debug Main Project: debug the main project, or the selected project if no main project is set |
| Ctrl + Shift + F5 | Ctrl + Shift + F5 | Debug File: start a debugging session for the current file |
| Ctrl + Shift + F6 | Ctrl + Shift + F6 | Debug Test File: start a debugging session for the test of the current file |
| Shift + F5 | Shift + F5 | Finish Debugger Session: end the debugging session |
| F5 | F5 | Continue: resume debugging until the next breakpoint or the end of the program |
| F8 | F8 | Step Over: execute one source line; if it is a method call, run the whole method and stop |
| Shift + F8 | Shift + F8 | Step Over Expression: step over the expression and then stop debugging |
| F7 | F7 | Step Into: execute one source line; if it is a method call, stop at its first statement |
| Shift + F7 | Shift + F7 | Step Into Next Method: run the project to the specified method and step into it |
| Ctrl + F7 | Ctrl + F7 | Step Out: run the current method and return control to the caller |
| F4 | F4 | Run to Cursor: run the project to the cursor location in the file and stop |
| Ctrl + F8 | Ctrl + F8 | Toggle Line Breakpoint: add or remove a breakpoint at the cursor location |
| Ctrl + Shift + F8 | Ctrl + Shift + F8 | New Breakpoint: set a new breakpoint at a line, exception or method you specify |
| Ctrl + Shift + F7 | Ctrl + Shift + F7 | New Watch: add the specified variable to the Watches window |
| Ctrl + F9 | Ctrl + F9 | Evaluate Expression: open the Evaluate Expression dialog box |
Windows and Views Shortcuts
Window shortcuts open the panels around the editor. Control plus 0 switches to the editor, Control plus 1 to 7 open the Projects, Files, Favorites, Output, Services, Action Items and Navigator windows, and Control plus Tab cycles through the open windows in the order they were last used.
| Shortcut (Windows/Linux) | Shortcut (macOS) | Function |
|---|---|---|
| Ctrl + 0 | Ctrl + 0 | Switch to Editor: switch to the Source Editor window |
| Ctrl + 1 to Ctrl + 7 | Ctrl + 1 to Ctrl + 7 | Switch to Window: open the Projects (1), Files (2), Favorites (3), Output (4), Services (5), Action Items (6) or Navigator (7) window |
| Ctrl + Shift + 7 | Ctrl + Shift + 7 | Properties Window: switch to the Properties window |
| Ctrl + Shift + 8 | Ctrl + Shift + 8 | Palette: open the Palette window |
| Ctrl + Tab | Ctrl + Tab | Switch to Recent Window: cycle through the open windows in the order they were last used |
| Ctrl + W | Command + W | Close Window: close the current tab; if the window has no tabs, close the whole window |
| Ctrl + F4 | Ctrl + F4 | Close Window: close the current window |
| Ctrl + Shift + W | Command + Shift + W | Close All Documents: close all open documents in the Source Editor |
| Shift + F4 | Shift + F4 | Documents: open the Documents dialog box to save and close groups of documents |
| Shift + Escape | Shift + Escape | Maximize Window: maximize the Source Editor or the current window |
While debugging, Alt plus Shift plus 1 to Alt plus Shift plus 8 open the debugger windows: Variables, Watches, Call Stack, Loaded Classes, Breakpoints, Sessions, Threads and Sources. The same Alt plus Shift plus number pattern works on macOS with Control plus Shift plus the number.
Java Code Templates
Code templates are not shortcuts, but they save just as much typing, and they sit on the same official shortcuts card. Type the abbreviation in the Source Editor and press Tab, and NetBeans expands it into the full code.
| Abbreviation + Tab | Expands To | Function |
|---|---|---|
| En | Enumeration | Insert an enumeration declaration |
| Ex | Exception | Insert an exception class declaration |
| Ob | Object | Insert an Object declaration |
| Psf | public static final | Insert a public static final variable declaration |
How to Create Custom Shortcuts in NetBeans
Every default shortcut in NetBeans is configurable, and you can assign a shortcut to any command that has none. Open the Options window from the Tools menu, or NetBeans then Preferences on a Mac, and click Keymap. To change a shortcut, double-click in the Shortcut column of the command and press the keys you want; the correct syntax appears as you press them. You cannot assign a shortcut that another command already uses. To find a shortcut for a command, type the command name in the Search field; to find the command behind a key combination, click in the Search in Shortcuts field and press the combination. NetBeans also ships with predefined shortcut profiles that match other editors and IDEs, so you can switch the whole keymap at once from the Profiles drop-down list. To keep a custom set, click Manage Profiles, duplicate a profile, give it a name, and edit the copy.
Tips for NetBeans Users
Learn shortcuts in small groups, starting with the five that save the most time every day: Control plus Space for completion, Alt plus Enter for hints, Alt plus Shift plus F to format, Control plus B to jump to a declaration, and Control plus E to delete a line. Use those five for a week, then add Control plus O to open a type, Alt plus Shift plus O to open a file, Control plus G to go to a line, and Control plus Shift plus M to bookmark a line you keep returning to. Use Control plus K and Control plus Shift plus K to complete a word from elsewhere in the file without retyping it. When a shortcut seems dead, check two things first: whether another window has the focus, and whether your keyboard layout is English, because some shortcuts are not detected on other layouts. Finally, open the official Keyboard Shortcuts Card from the Help menu and print it; it fits on one page and covers the whole list in this post.
Frequently Asked Questions
What is the latest version of NetBeans IDE?
The current version is Apache NetBeans 32, released on 16 November 2026. It is free and open source under the Apache License 2.0, and it runs on Windows, macOS and Linux. Every shortcut in this post was verified against the official NetBeans documentation and the official NetBeans keyboard shortcuts card.
What is the shortcut to format code in NetBeans?
Press Alt plus Shift plus F on Windows and Linux, or Control plus Shift plus F on a Mac, to format the selected code. If nothing is selected, NetBeans formats the whole file.
How do I generate getters and setters in NetBeans?
Place the caret inside the class body, not inside a method, and press Alt plus Insert on Windows and Linux, or Command plus N on a Mac. The Generate menu opens: choose Getter and Setter, tick the fields you want, and click Generate. The same menu generates constructors and other common code.
How do I jump to a declaration in NetBeans?
Place the caret on a class, method or variable name and press Control plus B on Windows and Linux, or Command plus B on a Mac. NetBeans jumps to the declaration. Press Control plus Shift plus B to jump to the source file that contains the definition instead.
How do I debug a project in NetBeans?
Press Control plus F5 on Windows, Linux and macOS to debug the main project. Press F5 to continue a paused program, F7 to step into a method call, F8 to step over it, and Control plus F7 to step out. Press Control plus F8 to set or remove a breakpoint on the current line, and Shift plus F5 to finish the debugging session.
Can I change keyboard shortcuts in NetBeans?
Yes. Open Tools, then Options, then Keymap, or NetBeans, then Preferences, then Keymap on a Mac. Double-click in the Shortcut column of any command and press the keys you want. To keep your changes, duplicate a profile first with Manage Profiles, because the predefined profiles cannot be edited directly. You can also switch to a predefined profile that matches another editor or IDE.
Why are my NetBeans shortcuts not working?
The most common causes are the wrong keymap profile for your operating system, a keyboard without an English layout, which can stop some shortcuts being detected, and a function key your operating system has claimed for itself, for example brightness or volume. Check the profile in Tools, then Options, then Keymap, switch to an English layout, and enable function keys if F-keys do nothing.
By Umar Farooq, Tech Know.


0 Comments