In this article, we will learn about how to use shortcut keys in Netbeans. Let’s get started.
Table of contents
- Operations with lines
- Operations with source code
- Operations with Window
- Search operations
- Run, debug source code
- Shortcut keys
- Wrapping up
Operations with lines
| Shortcut keys | Definition |
|---|---|
Ctr + E or Shift + Delete |
Delete the current line |
Ctrl + Delete |
Delete the next word after the cursor |
Ctrl + Backspace |
Delete the previous word before the cursor |
Alt + Shift + Up |
Move up the current line |
Alt + Shift + Down |
Move down the current line |
Ctrl + Shift + Up |
Copy and move up the current line |
Ctrl + Shift + Down |
Copy and move down the current line |
Shift + Enter |
Insert a blank line below the current line |
Ctrl + Enter |
Insert a blank line above the current line |
Operations with source code
| Shortcut keys | Definition |
|---|---|
Ctrl + Shift + I |
Organizes import statements by removing unused imports and adding missing ones |
Alt + Shift + F |
Format a selected block |
Ctrl + Shift + C or Ctrl + / |
Toggle comment for the current line or a selected block of code |
Alt + Insert |
Show context menu to generate code |
Alt + Shift + F |
Format selection (Indent) |
Ctrl + Shift + R |
Rectangle selection (toggle) |
Ctrl + R |
Rename |
Operations with Window
| Shortcut keys | Definition |
|---|---|
Ctrl + F12 |
Inspect members of a class |
Alt + F12 |
Inspect hierarchy of a class |
Ctrl + Shift + Enter |
Toggle maximum/minimum of the current editor |
Ctrl + Tab or Ctrl + ` |
Switch between open documents by order used |
Search operations
| Shortcut keys | Definition |
|---|---|
Ctrl + F3 |
Search word at insert point |
F3 or Shift + F3 |
Find next/previous in file |
Ctrl + F or Ctrl + H |
Find or Replace in file |
Ctrl + Shift + F or Ctrl + Shift + H |
Find or Replace in project |
Alt + F7 |
Find usages |
Ctrl + O or Alt + Shift + O |
Go to type/file |
Alt + Up or Alt + Down |
Next/previous marked occurrence |
Alt + Shift + L |
Copy file path |
Run, debug source code
| Shortcut keys | Definition |
|---|---|
F11 |
Build main project |
Shift + F11 |
Clean and build main project |
Ctrl + Q |
Set request parameters |
Ctrl + Shift + U |
Create Unit test |
Ctrl+ F6/Alt + F6 |
Run Unit test on file/project |
F6/Shift + F6 |
Run main project/file |
Ctrl + F5 |
Start debugging main project |
Ctrl + Shift + F5 |
Start debugging current file |
Ctrl + Shift + F6 |
Start debugging test for file |
Shift + F5/F5 |
Stop/Continue debugging session |
F4 |
Run to cursor location in file |
F7/F8 |
Step into/over |
Ctrl + F7 |
Step out |
Ctrl + Alt + Up |
Go to called method |
Ctrl + Alt + Down |
Go to calling method |
Ctrl + F9 |
Evaluate expression |
Ctrl + F8 |
Toggle breakpoint |
Ctrl + Shift + F8 |
New breakpoint |
Ctrl + Shift + F7 |
New watch |
Shortcut keys
-
With data type
Shortcut keys Definition EnEnumeration boboolean StString ExException dbdouble flfloat fafalse shshort vovolatile iofinstance of fifinal -
With control statements
Shortcut keys Definition brbreak cncontinue dfdefault whwhile ththrows fyfinally twthrow -
With class
Shortcut keys Definition clclass ababstract exextends pupublic prprivate peprotected imimplements ieinterface -
With methods
Shortcut keys Definition psvmpublic static void main Psfpublic static final Psfbpublic static final boolean Psfipublic static final int Psfspublic static final String asassert true cacatch eqequal psfprivate static final psfbprivate static final boolean psfiprivate static fianl int psfsprivate static final String pstprintStackTrace() lelength soutSystem.out.println() soutvSystem.out.println(“obj”+obj) irimport bcom/**/
Wrapping up
- We should use shorcut keys to improve typing code in Netbeans.
Refer: