Quick Typing (Code Templates) in NetBeans

A good programming editor will help you get your code written faster. There are many ways editors do this. One way it to make it easier to write often written and long, hard to type code. NetBeans helps you write your code faster in several ways. In particular, NetBeans's code templates feature helps you write hard to type, lengthy code faster.

Code templates are short menmonics which can be expanded to code. For example, if you open a Java file in NetBeans, go to an empty line, and type 'sout', then hit Ctrl-Space, NetBeans will expand this to 'System.out.println("");' and place the cursor between the two double quotes. System.out.println is an often-used line of code and typing 'sout Ctrl-Space' is much easier then reaching for the () and " keys. 'fori', for a for loop, and 'En' for Enumeration are also useful. You can also create your own code templates for lengthy code you may be using in your project. This may include classes, method calls, exceptions, and comments.

To modify code templates in NetBeans 5.0, go to Tools->Options->Editor->Code Templates. There you'll see the list of code templates for each language supported in NetBeans. You can add, modify, and remove code templates to suit your needs
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Darryl Mocek

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today