14
2011
Netbeans Shortcut ( Part II )
Continuing on my series of stones on Netbeans, I bring on the second part of the shortcuts in Netbeans. This post will primarily deal with the various coding shortcuts NetBeans has to offer along with a few editor code templates. So without any further ado let’s begin.
Move/copy up/down.
Press Ctrl-Shift-Up and the current selection are copied to the lines right above the current selection. Press Alt instead of Ctrl and it is moved instead of copied. Press Down instead of Up and the lines of code will be copied below the current selection, as below:
Generate code skeletons.
Whenever you want to generate commonly needed pieces of code, such as constructors, getters, and setters, simply click Alt-Insert, and a small popup appears with a list of items from which you can select. Netbeans will automatically detect all the fields available for the getter and setters.
Inplace rename.
If you want to change a variable, method, or other item, of which more than one are used in your code, press Ctrl-R, and you will see a dialogue box pop-up asking you to enter the new name for the item selected. Enter the new name and then press Refractor, all the instances of that given item is renamed in the code
Add/Remove comment lines.
Select one or more lines, press Ctrl-/ and then the selected lines are commented out, as shown below. Press the same keys again and the commented lines will no longer be commented.
Inspect members/hierarchy.
Both the members of the current class as well as its hierarchy can be displayed and then filtered. Press Alt-F12 and the hierarchy of the current file are shown. On the other hand, if you press Ctrl-F12, the current file’s members are displayed.
Insert semi-colon in the end.
To enter a semicolon at the end of the line press Ctrl-Shift-; or just Ctrl-;. The Ctrl-Shift-; option takes the caret to the next line while the Ctrl-; option keeps the caret on the same line.
Minimize/Maximize code segments.
To minimize/maximize code segments in Netbeans use Ctrl and -/+ or Ctrl-Shift and -/+. The option containing Shift maximizes or minimizes all the code segments in the current file this includes all the imports, methods, constructors and also comments segments.
Java Editor Code Templates.
And finally the Java code templates which makes coding so much easier and faster in Netbeans. When typing in the source editor you can generate the following texts by using the abbreviation listed against it in the following table
Subscribe to fortystones.
Follow @fortystones on Twitter.
Get updated from our Facebook Fanpage.
Related Posts
1 Comment + Add Comment
Leave a comment
Fortystones Lab Projects
Categories
- Articles (43)
- Idea (2)
- Review (5)
- Social Media (29)
- Trending Topics (13)
- Collection (29)
- How To (27)
- Linux (26)
- News (15)
- PHP (6)
- Project (1)
- Tutorials (35)
- Java (4)
- Programming (10)
- Wordpress (7)
Popular Posts
- 40 Basic Linux Command-line Tips and Tricks
- Tips and Tricks for Facebook Chat (Save History/ Video Chat/ Send Files)
- The First on the World Wide Web
- 40 Linux Shell Commands for Beginners
- Online Coding Zones for Programmers
- Special: Facebook Smiley, Special Text Symbols and ASCII Arts
- 13 years of Google: 1997- Present

An article by Prerak Pradhan












Brilliant
Thanks a lot