This tutorial explains all the frequently used shortcuts and hotkeys for Netbeans.

This useful keyboard shortcut helps developers improve productivity and save time.

Shortcut Comment and uncomment code

Ctrl + / in Windows, Cmd + / in Mac OS the command used to comment on the code.

You can also use Ctrl + Shift + C If you want to uncomment the code, Run the same command one more time.

shortcut key for collapsing/expanding a method in NetBeans

ShortcutkeyDescriptionMacOS
Collapse single a block or methodCtrl + - + -
Expand a single block or methodCtrl + + + +
Collapse All a blocks or methodsCtrl + Shift + - + Shift +-
Expand a All blocks or methodsCtrl + Shift + + + Shift ++

Shortcut Keys to UPPERCASE and lowercase

ShortcutkeyWindows/LinuxMacOS
Upper CaseFirst, use Ctrl + U, next use UFirst, use + U, next use U
Lower CaseFirst, use Ctrl + U, next use LFirst, use + U, next use L
Reverse CaseFirst, use Ctrl + U, next use SFirst, use + U, next use S

Netbeans File Shortcut keys

ParameterWindows/LinuxMAC OS
New ProjectCtrl + Shift + N⌘ + Shift + N
New FileCtrl + N
Open New projectsCtrl + Shift + O
Open Recent ProjectCtrl + Shift + T
SaveCtrl + S
Save AllCtrl + Shift + S
Print fileCtrl + Alt + Shift + P

Netbeans Edit Shortcut keys

OperationHot keys
UndoCtrl + Z
RedoCtrl + Shift + Z
CutCtrl + X
CopyCtrl + C
PasteCtrl + V
Paste from HistoryCtrl + Shift + D
Paste from LinesCtrl + Shift + L
FindCtrl + F
ReplaceCtrl + H
Find in ProjectsCtrl + Shift + F
Replace in ProjectsCtrl + Shift + H

Netbeans Short-cut keys for Compile and Run

OperationHot keys
Run ProjectF6
Test ProjectAlt + F6
Build ProjectF11
Clean & Build ProjectShift + F11

Other Shortcuts

OperationHot keys
Go to Line numberCtrl + G
Delete a LineCtrl + X or Ctrl + E
FormatAlt + Shift + F

Shortcut command to open a file

To open a file dialog, please run Alt + Shift + O

You can also use the Alt + F + O option to open the file from the window file system. You can also use Ctrl + Shift + o to open the file dialog.