NetBeans IDE Keyboard Shortcut Keys: Complete List (With Functions Explained)

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 + SpaceCtrl + SpaceComplete Code: show the code completion box with suggestions at the caret
Alt + EnterCtrl + EnterShow Hints / Fix Code: show quick-fixes for an error and intention actions, including Surround With
Ctrl + BCommand + BGo to Declaration: jump to the declaration of the item under the cursor
Alt + Shift + FCtrl + Shift + FFormat: format the selected code, or the whole file if nothing is selected
Ctrl + Shift + ICommand + Shift + IFix Imports: generate the import statements the classes in the file need
Ctrl + OCommand + OGo to Type: find and open a specific class or interface
Alt + Shift + OCtrl + Shift + OGo to File: find and open a specific file
Ctrl + GCtrl + GGo 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 + NCommand + Shift + NNew Project: create a new project with the New Project wizard
Ctrl + NCommand + NNew File: create a new file with the New File wizard
Ctrl + Shift + OCommand + Shift + OOpen Project: open an existing project
Ctrl + SCommand + SSave: save the current file
Ctrl + Shift + SCommand + Shift + SSave All: save every open file
Ctrl + Alt + Shift + PCommand + Option + Shift + PPrint: print the current file
F1F1Help: show the help topic for the current user interface element
Shift + F1Shift + F1Javadoc 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 + ZCommand + ZUndo: reverse the last editor action, except Save
Ctrl + YCommand + YRedo: reverse an Undo command
Ctrl + XCommand + XCut: cut the current selection to the clipboard
Ctrl + CCommand + CCopy: copy the current selection to the clipboard
Ctrl + VCommand + VPaste: paste the contents of the clipboard at the insertion point
Ctrl + Shift + VCommand + Shift + VPaste Formatted: paste the formatted contents of the clipboard
Ctrl + ACommand + ASelect All: select everything in the current document or window
Alt + Shift + JCtrl + Shift + JSelect Identifier: select the current identifier
Ctrl + ECommand + EDelete Current Line: delete the whole line the caret is on
Ctrl + Shift + DCommand + Shift + DShow Clipboard History: pick an earlier clipboard entry to paste
Ctrl + U, then UCtrl + U, then UConvert Selection to Uppercase: change the selected text to capital letters
Ctrl + U, then LCtrl + U, then LConvert Selection to Lowercase: change the selected text to small letters
Ctrl + U, then SCtrl + U, then SToggle 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 + FCommand + FFind: find text in the current file
Ctrl + HCommand + RReplace: find a string of text and replace it with another string
F3Command + GFind Next: find the next instance of the found text
Shift + F3Command + Shift + GFind Previous: find the previous instance of the found text
Ctrl + F3Command + F3Find Selection: find instances of the word at the insertion point
Ctrl + KCommand + KInsert Next Matching Word: complete the word you are typing with the next matching word in the file
Ctrl + Shift + KCommand + Shift + KInsert Previous Matching Word: complete the word you are typing with the previous matching word in the file
Ctrl + Shift + FCommand + Shift + FFind in Projects: find text, object names or object types within projects
Ctrl + Shift + HCommand + Shift + HReplace in Projects: replace text, object names or object types within projects
Alt + F7Ctrl + F7Find Usages: find usages and subtypes of the selected code
Alt + Shift + UCtrl + Shift + UFind Usages Results: show the results of a Find Usages search
Alt + Shift + HCtrl + Shift + HTurn 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 + BCommand + Shift + BGo to Source: show the source file containing the definition of the selected class
Ctrl + Shift + PCommand + Shift + PGo to Super Implementation: jump to the super implementation of the item under the cursor
Ctrl + Shift + TCommand + Shift + TGo to Test: find and open the test for the current class
Ctrl + QCommand + QLast Edit Location: scroll the editor to the last place where editing occurred
Alt + LeftCommand + LeftBack: navigate back to the previously opened document
Alt + RightCommand + RightForward: navigate forward to the next opened document
Ctrl + Shift + MCommand + Shift + MToggle Bookmark: set or remove a bookmark on the current line
Ctrl + Shift + PeriodCommand + Shift + PeriodNext Bookmark: cycle forward through the bookmarks
Ctrl + Shift + CommaCommand + Shift + CommaPrevious Bookmark: cycle backwards through the bookmarks
Ctrl + PeriodCtrl + PeriodNext Error: scroll the editor to the line with the next build error
Ctrl + CommaCtrl + CommaPrevious Error: scroll the editor to the line with the previous build error
Ctrl + F12Command + F12Member Hierarchy: open the member hierarchy of the current class
Alt + F12Ctrl + F12Type Hierarchy: open the type hierarchy of the current class
Alt + Shift + F12Ctrl + Shift + F12Inspect Hierarchy: inspect the code hierarchy of the current class
Ctrl + Shift + 1 / 2 / 3Command + Shift + 1 / 2 / 3Select in Projects / Files / Favorites: show the current file in the Projects, Files or Favorites window
Alt + Shift + LCtrl + Shift + LCopy 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 + SpaceCommand + Shift + SpaceShow Documentation: show the documentation for the item under the cursor
Ctrl + PCommand + PShow Method Parameters: show the parameters of the method at the caret
Alt + InsertCommand + NInsert Code: open the Generate menu for constructors, getters, setters and other code
Ctrl + / or Ctrl + Shift + CCommand + / or Command + Shift + CToggle Comment: comment or uncomment the current line or selected lines
Alt + Shift + ICtrl + Shift + IFix Selected Class Import: generate the import statement for the class at the caret
Alt + Shift + LeftCtrl + Shift + LeftShift Line Left: move the selected line or lines one tab to the left
Alt + Shift + RightCtrl + Shift + RightShift Line Right: move the selected line or lines one tab to the right
Alt + Shift + UpCtrl + Shift + UpMove Line Up: move the selected line or lines one line up
Alt + Shift + DownCtrl + Shift + DownMove Line Down: move the selected line or lines one line down
Ctrl + Shift + UpAlt + Shift + UpCopy Lines Up: copy the selected line or lines one line up
Ctrl + Shift + DownAlt + Shift + DownCopy Lines Down: copy the selected line or lines one line down
Ctrl + Shift + RCommand + Shift + RToggle Rectangular Selection: switch rectangular block selection off or on
Ctrl + Minus / Ctrl + PlusCommand + Minus / Command + PlusCollapse / 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 + RCtrl + RRename: rename the symbol at the caret in place, everywhere it is used
Ctrl + MCtrl + MMove: move the symbol at the caret in place
Alt + DeleteCtrl + DeleteSafely 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
F9F9Compile File: compile the current file, or only the changed files in a folder
F11F11Build Main Project: build the main project, or the selected project if no main project is set
Shift + F11Shift + F11Clean and Build Main Project: delete all previously compiled files and outputs, then build the project
F6F6Run Main Project: run the main project, or the selected project if no main project is set
Shift + F6Shift + F6Run File: run the currently selected file
Ctrl + F6Ctrl + F6Test File: start the unit test for the current file
Alt + F6Alt + F6Test Project: start the unit test for the project
Ctrl + F11Ctrl + F11Repeat Build / Run: build or run the selected project once again
Ctrl + Shift + UCommand + Shift + UCreate Unit Test: create a unit test for the current class
Alt + F9Alt + F9Check File: check the file dependencies in the current project when building
Alt + Shift + F9Alt + Shift + F9Validate 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 + F5Ctrl + F5Debug Main Project: debug the main project, or the selected project if no main project is set
Ctrl + Shift + F5Ctrl + Shift + F5Debug File: start a debugging session for the current file
Ctrl + Shift + F6Ctrl + Shift + F6Debug Test File: start a debugging session for the test of the current file
Shift + F5Shift + F5Finish Debugger Session: end the debugging session
F5F5Continue: resume debugging until the next breakpoint or the end of the program
F8F8Step Over: execute one source line; if it is a method call, run the whole method and stop
Shift + F8Shift + F8Step Over Expression: step over the expression and then stop debugging
F7F7Step Into: execute one source line; if it is a method call, stop at its first statement
Shift + F7Shift + F7Step Into Next Method: run the project to the specified method and step into it
Ctrl + F7Ctrl + F7Step Out: run the current method and return control to the caller
F4F4Run to Cursor: run the project to the cursor location in the file and stop
Ctrl + F8Ctrl + F8Toggle Line Breakpoint: add or remove a breakpoint at the cursor location
Ctrl + Shift + F8Ctrl + Shift + F8New Breakpoint: set a new breakpoint at a line, exception or method you specify
Ctrl + Shift + F7Ctrl + Shift + F7New Watch: add the specified variable to the Watches window
Ctrl + F9Ctrl + F9Evaluate 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 + 0Ctrl + 0Switch to Editor: switch to the Source Editor window
Ctrl + 1 to Ctrl + 7Ctrl + 1 to Ctrl + 7Switch to Window: open the Projects (1), Files (2), Favorites (3), Output (4), Services (5), Action Items (6) or Navigator (7) window
Ctrl + Shift + 7Ctrl + Shift + 7Properties Window: switch to the Properties window
Ctrl + Shift + 8Ctrl + Shift + 8Palette: open the Palette window
Ctrl + TabCtrl + TabSwitch to Recent Window: cycle through the open windows in the order they were last used
Ctrl + WCommand + WClose Window: close the current tab; if the window has no tabs, close the whole window
Ctrl + F4Ctrl + F4Close Window: close the current window
Ctrl + Shift + WCommand + Shift + WClose All Documents: close all open documents in the Source Editor
Shift + F4Shift + F4Documents: open the Documents dialog box to save and close groups of documents
Shift + EscapeShift + EscapeMaximize 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 + TabExpands ToFunction
EnEnumerationInsert an enumeration declaration
ExExceptionInsert an exception class declaration
ObObjectInsert an Object declaration
Psfpublic static finalInsert 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.

Post a Comment

0 Comments