You are on page 1of 4

NetBeans 5.

0 Keyboard Shortcuts and Code Templates


Finding, Searching, and Replacing Esc/Ctrl-Space Close/Open code completion Shift-F10 Open contextual menu
Ctrl-M Select next parameter
Ctrl-F3 Search for word at insertion point Shift-Space Enter space, no abbrev expansion Compiling, Testing, and Running
F3/Shift-F3 Find next/previous in file Alt-F1/Shift-F1 Display/search Javadoc
Ctrl-F/H Find/Replace in file F9 Compile selected package or file
Ctrl-Shift-M Extract method F11 Build main project
Alt-F7 Find usages Alt-U, then G Prepend “get” to identifier
Ctrl-Shift-P Find in projects Shift-F11 Clean & build main project
Alt-U, then S Prepend “set” to identifier Ctrl-Q Set request parameters
Alt-Shift-U Show Usages window Alt-U, then I Prepend “is” to identifier
Alt-Shift-H Turn off search result highlights Ctrl-Shift-U Create JUnit test
Ctrl-Backspace/Del Delete previous/current word Ctrl-F6/Alt-F6 Run JUnit test on file/project
Alt-Shift-L Next in jump list (all files) Ctrl-E Delete the current line
Alt-Shift-K Previous in jump list (all files) F6/Shift-F6 Run main project/file
Ctrl-J, then S/E Start/end recording macro
Ctrl-R Reload form Ctrl-Shift-J Insert internationalized string Debugging
Alt-U, then U Convert selection to uppercase Ctrl-NumPad - Collapse (hide) a block of code
Alt-U, then L Convert selection to lowercase Ctrl-NumPad + Expand a collapsed block of code F5 Start debugging main project
Alt-U, then R Switch case of selection (toggle) Ctrl-Shift-NumPad- Collapse all code blocks Ctrl-Shift-F5 Start debugging current file
Ctrl-Shift-NumPad+ Expand all code blocks Ctrl-Shift-F6 Start debugging test for file (JUnit)
Navigating through Source Code Alt-Enter Show suggestion/tip/hint Shift-F5/Ctrl-F5 Stop/Continue debugging session
Alt-Shift-O Go to class F4 Run to cursor location in file
Alt-Shift-E Go to JUnit test Opening and Toggling between Views F7/F8 Step into/over
Alt-O Go to source Ctrl-F7 Step out
Ctrl-Shift-0 Show Search Results window Ctrl-Alt-Up Go to called method
Alt-G Go to declaration Ctrl-0 Show Source Editor
Ctrl-B Go to super implementation Ctrl-Alt-Down Go to calling method
Ctrl-1 Show Projects window Ctrl-F9 Evaluate expression
Alt-K/Alt-L Back/Forward Ctrl-2 Show Files window
Ctrl-G Go to line Ctrl-F8 Toggle breakpoint
Ctrl-3 Show Favorites window Ctrl-Shift-F8 New breakpoint
Ctrl-F2 Toggle add/remove bookmark Ctrl-4 Show Output window
F2/Shift-F2 Next/previous bookmark Ctrl-Shift-F7 New watch
Ctrl-5 Show Runtime window Ctrl-Shift-5 Show HTTP Monitor
F12/Shift-F12 Next/previous usage/compile error Ctrl-6 Show To Do window
Ctrl-Shift-1/2/3 Select in Projects/Files/Favorites Ctrl-Shift-0 Show Search Results window
Ctrl-7 Show Navigator window Alt-Shift-1 Show Local Variables window
Ctrl-[ Move caret to matching bracket Ctrl-Shift-7 Show Properties dialog box
Ctrl-^ Ctrl-[ (French/Belgian keyboard) Alt-Shift-2 Show Watches window
Ctrl-Shift-8 Show Component Palette Alt-Shift-3 Show Call Stack window
Coding in Java Ctrl-8 Show Versioning window Alt-Shift-4 Show Classes window
Ctrl-9 Show VCS Output window Alt-Shift-5 Show Breakpoints window
Ctrl-I Override method Shift-F4 Show Documents dialog box Alt-Shift-6 Show Sessions window
Alt-Shift-F/I Fix all/selected class's imports Alt-Left Arrow Tab to window on left Ctrl-Shift-6 Switch to Execution window
Alt-Shift-W Surround with try-catch block Alt-Right Arrow Tab to window on right Alt-Shift-7 Switch to Threads window
Ctrl-Shift-F Reformat selection Ctrl-Tab (Ctrl-`) Toggle between open documents Alt-Shift-8 Switch to Sources window
Ctrl-D/Ctrl-T Shift one tab to the left/right Shift-Escape Maximize window (toggle)
Ctrl-Shift-T/D Add/remove comment lines ("//") Ctrl-F4/Ctrl-W Close currently selected window
Ctrl-L/K Insert next/previous matched word Ctrl-Shift-F4 Close all windows
NetBeans 5.0 Keyboard Shortcuts and Code Templates
When typing in the Source Editor, you can generate the text in the newo Object name = new Object(args); pcgn pageContext.getAttributeNamesInScope("|")
right-column of the following list by typing the abbreviation that is pe protected pcgs pageContext.getAttributesScope("|")
listed in the left-column and then pressing Space. pr private pcr pageContext.removeAttribute("|")
psf private static final pcs pageContext.setAttribute("|",)
Java Editor Code Templates psfb private static final boolean pg <%@page |%>
En Enumeration psfi private static final int pga <%@page autoFlush="false"%>
Ex Exception psfs private static final String pgb <%@page buffer="|kb"%>
Ob Object pst printStackTrace(); pgc <%@page contentType="|"%>
Psf public static final psvm public static void main(String[] args){ pgerr <%@page errorPage="|"%>
Psfb public static final boolean } pgex <%@page extends="|"%>
Psfi public static final int pu public pgie <%@page isErrorPage="true"%>
Psfs public static final String re return pgim <%@page import="|"%>
St String serr System.err.println ("|"); pgin <%@page info="|"%>
ab abstract sout System.out.println ("|"); pgit <%@page isThreadSafe="false"%>
bo boolean st static pgl <%@page language="java"%>
br break sw switch ( pgs <%@page session="false"%>
ca catch ( sy synchronized rg request.getParameter("|")
cl class tds Thread.dumpStack(); sg session.getAttribute("|")
cn continue th throws sp session.setAttribute("|", )
df default: trycatch try {} sr session.removeAttribute("|")
dowhile do { catch (Exception e) {} tglb <%@taglib uri="|"%>
} while (condition); tw throw
eq equals twn throw new XML/DTD Editor Code Templates
ex extends wh while (
whilei while (it.hasNext()) { ?xm <?xml version="1.0" encoding="UTF-8"?>
fa false !do <!DOCTYPE>
fi final Object elem = (Object) it.next();
} !cd <![CDATA[|]]>
fl float !at <!ATTLIST |>
forc for (Iterator it = collection.iterator();
it.hasNext();) { JSP Editor Code Templates !el <!ELEMENT |>
!en <!ENTITY |>
Object elem = (Object) it.next(); ag application.getAttribute("|") pu PUBLIC "|"
} ap application.putAttribute("|",) sy SYSTEM "|"
fore for (Object elem : iterable) { ar application.removeAttribute("|") !no <!NOTATION |>
} cfgi config.getInitParameter("|") cd CDATA
fori for (int i = 0; i < arr.length; i++) { jspf <jsp:forward page="|"/> em EMPTY
} jspg <jsp:getProperty name="|" property="" /> en ENTITY
fy finally jspi <jsp:include page="|"/> ens ENTITIES
ie interface <jsp:plugin type="|" code="" fi #FIXED
ifelse if (condition){}else { jspp
codebase=""></jsp:plugin> im #IMPLIED
} jsps <jsp:setProperty name="|" property=""/> nm NMTOKEN
im implements jspu <jsp:useBean id="I" type=""/> nms NMTOKENS
iof instanceof oup out.print("|") nn NOTATION
ir import oupl out.println("|") pc #PCDATA
le length pcg pageContext.getAttribute("|")
NetBeans 5.0 Keyboard Shortcuts and Code Templates
Ctrl-F2 Toggle add/remove bookmark Ctrl-2 Show Files window
Emacs Keyboard Shortcuts F2/Shift-F2 Next/previous bookmark Ctrl-3 Show Favorites window
F12/Shift-F12 Next/previous error Ctrl-4 Show Output window
General Keyboard Shortcuts Ctrl-5 Show Runtime window
Ctrl-W, Alt-W, Ctrl-YCut/Copy/Paste Coding in Java Ctrl-6 Show To Do window
Ctrl-X, then U Undo Alt-Enter Show suggestion/tip/hint Ctrl-7 Show Navigator window
Ctrl-Shift- Z Redo Alt-0, then Ctrl-X, Shift one tab to the left Ctrl-Shift-7 Show Properties dialog box
Ctrl-X, then H Select all then Tab Ctrl-8 Show Versioning Window
Ctrl-X, then Ctrl-S Save Ctrl-X, then Tab Shift one tab to the right Ctrl-Shift-8 Show Component Palette
Ctrl-X, then S Save all Ctrl-C, then Ctrl-C Comment out lines ("//") Ctrl-9 Show VCS Output window
Alt-0, then Ctrl-C, Remove comment out lines ("//") Alt-Left Arrow Tab to window on left
Finding, Searching, and Replacing then Ctrl-C Alt-Right Arrow Tab to window on right
Ctrl-S/Ctrl-H Find/replace in file Alt-SLASH Insert next matched word Ctrl-Tab (Ctrl-`) Toggle between open documents
Alt-S/Alt-R Find next/previous in file Ctrl-Q, then Tab Insert Tab
Alt-F7 Find usages Ctrl-X, then Shift-9/0 Start/stop recording macro
Compiling, Testing, and Running
Ctrl-Shift-P Find in projects Alt-D Delete next word F9 Compile selected package or file
Ctrl-Alt-F Show Usages window Alt-Backspace Delete previous word F11 Build main project
Ctrl X, then Ctrl-U Convert selection to uppercase Ctrl-D Delete next character Shift-F11 Clean & build main project
Ctrl-X, then Ctrl-L Convert selection to lowercase Backspace Delete previous character Ctrl-Q Set request parameters
Alt-0, then Ctrl-K Cut to start of line Ctrl-Shift-U Create JUnit test
Navigating through Source Code Ctrl-K Cut to end of line Ctrl-F6/Alt-F6 Run JUnit test on file/project
Ctrl-I Override method Ctrl-Shift-MINUS Collapse all code blocks F6/Shift-F6 Run main project/file
Alt-Shift-F Fix all imports Ctrl-Shift-PLUS Expand all code blocks
Alt-Shift-I Fix selected class's imports Ctrl-Shift-M Extract method Debugging
Alt-Shift-W Surround with try-catch block F5 Start debugging main project
Ctrl-Shift-F Reformat selection
Opening and Toggling between Views
Ctrl-Shift-F5 Start debugging current file
Alt-Shift-O Go to class Ctrl-Alt-N New file Ctrl-Shift-F6 Start debugging test for file
Alt-Shift-E Go to JUnit test Ctrl-Shift-N New project (JUnit)
Alt-PERIOD Go to declaration Ctrl-X, then Ctrl-F Open a file Shift-F5/Ctrl-F5 Stop/Continue debugging session
Ctrl-G Go to line Ctrl-Shift-O Open a project F4 Run to cursor location in file
Ctrl-B Go one character to the left Ctrl-X, then B Show Documents dialog box F7/F8 Step into/over
Ctrl-F Go one character to the right Ctrl-X, then 1 Maximize window (toggle) Ctrl-F7 Step out
Alt-B/F Go one word to the left/right Ctrl-X, then Ctrl-K Close currently selected document Ctrl-Alt-Up Go to called method
Ctrl-N/P Go one row down/up Ctrl-X, then K (same as above) Ctrl-Alt-Down Go to calling method
Ctrl-A/Ctrl-E Go to start/end of line Ctrl-X, then Ctrl-C Exit the IDE Ctrl-F9 Evaluate expression
Alt-V/Ctrl-V Go up/down one page Ctrl-Shift-0 Show Search Results window Ctrl-F8 Toggle breakpoint
Alt-Shift-COMMA Go to start of document Ctrl-0 Show Source Editor Ctrl-Shift-F8 New breakpoint
Alt-Shift-PERIOD Go to end of document Ctrl-1 Show Projects window Ctrl-Shift-F7 New watch
Ctrl-Shift-1/2/3 Select in Projects/Files/Favorites
NetBeans 5.0 Keyboard Shortcuts and Code Templates
Ctrl-Backspace Delete previous word Debugging
Eclipse Keyboard Shortcuts Delete Delete next character
Backspace Delete previous character F11 Start debugging main project
Finding, Searching, and Replacing Ctrl-D Delete current line Ctrl-Shift-F5 Start debugging current file
FIND/Ctrl-Shift-F Find/replace in file Ctrl-Shift-MINUS Collapse all code blocks Ctrl-Shift-F6 Start debugging test for file (JUnit)
Ctrl-K/Ctrl-Shift-K Find next/previous in file Ctrl-Shift-PLUS Expand all code blocks Shift-F5/F8 Stop/Continue debugging session
Alt-F7 Find usages Alt-Shift-M Extract method Ctrl-R Run to cursor location in file
Ctrl-H Find in projects F5/F6 Step into/over
Alt-Shift-U Show Usages window Opening and Toggling between Views Ctrl-F7 Step out
Ctrl-Shift-X Convert selection to uppercase Ctrl-Alt-Up Go to called method
Ctrl-N New file Ctrl-Alt-Down Go to calling method
Ctrl-Shift-Y Convert selection to lowercase Ctrl-Shift-N New project Ctrl-F9 Evaluate expression
Navigating through Source Code Ctrl-O Open a file Ctrl-Shift-B Toggle breakpoint
Ctrl-Shift-O Open a project Ctrl-Shift-F8 New breakpoint
Alt-Shift-O Go to class Ctrl-Shift-E Show Documents dialog box Ctrl-Shift-F7 New watch
Alt-Shift-E Go to JUnit test Ctrl-M Maximize window (toggle)
Ctrl-F3 Go to source Ctrl-F4/Ctrl-W Close currently selected document To change a code template or keyboard shortcut:
F3 Go to declaration Ctrl-Shift-0 Show Search Results window 1. Choose Tools > Options from the main menu.
Ctrl-L Go to line F12 Show Source Editor 2. For code templates:
LEFT Go one character to the left Ctrl-1 Show Projects window • Select Editor in the left sidebar.
RIGHT Go one character to the right Ctrl-2 Show Files window • Click the Code Templates tab.
Ctrl-LEFT/RIGHT Go one word to the left/right Ctrl-3 Show Favorites window • Choose a language from the Language drop-
UP/DOWN Go one row down/up Ctrl-4 Show Output window down list.
Ctrl-Shift-1/2 Select in Projects/Files Ctrl-5 Show Runtime window 3. For keyboard shortcuts:
Ctrl-F2 Toggle add/remove bookmark Ctrl-6 Show To Do window • Select Keymap in the left sidebar.
Shift-F2 Previous bookmark Ctrl-7 Show Navigator window • Choose a profile from the Profile drop-down list.
Ctrl-PERIOD Next usage/compile error Ctrl-Shift-7 Show Properties dialog box 4. Change the item and click OK.
Ctrl-COMMA Previous usage/compile error Ctrl-8 Show Versioning window
Ctrl-Alt-Shift-P Move caret to matching bracket Ctrl-Tab Toggle between open documents To change how a code template is expanded:
Alt-LEFT Back 1. Choose Tools > Options from the main menu.
Alt-RIGHT Forward Compiling, Testing, and Running 2. Select Editor in the left sidebar.
3. Click the Code Templates tab.
Coding in Java F9 Compile selected package or file 4. Choose a language from the Language drop-down list.
F11 Build main project 5. Select the expander key from the Expand Template On
Ctrl-I Override method Shift-F11 Clean & build main project drop-down list and click OK.
Alt-Shift-W Surround with try-catch block Ctrl-Q Set request parameters
Ctrl-Shift-O Fix all imports Ctrl-Shift-U Create JUnit test To choose a different profile:
Ctrl-Shift-M Fix selected class's imports Ctrl-F6/Alt-F6 Run JUnit test on file/project 1. Choose Tools > Options from the main menu.
Alt-Enter Show suggestion/tip/hint Ctrl-Shift-F11 Run main project 2. Select Keymap in the left sidebar.
Alt-SLASH Insert next matched word Shift-F6 Run file 3. Choose a profile from the Profile drop-down list and
Ctrl-Delete Delete next word click OK.

You might also like