Code Snippets in NetBeans

Just found out how to use Code Snippets in Java. A pretty basic feature which I found useful so thought I would share.

This basically saves you time when typing the same command regularlly. If you don't completely understand, just try it out and see what you think. I wish I had found it years ago!

To complete;
  1. Open NetBeans
  2. Click Tools, Options
  3. Click Editor button
  4. Click Code Templates Tab
  5. Click New
  6. Type in Abbreviation and press OK. Example 'So'
  7. Within Expanded Text, type in the code you want to display when you type the abbreviation. An example may be System.out.println("");
  8. To change the way the code is inserted into the java document, click the drop down box for Expand Template and select whatever you want. I just left it on default, Tab.
  9. Go back to your Java document and type the abbreviation followed by Tab.


Have Fun

Comments

Post a Comment

Popular posts from this blog

Create bootable CUC CUCM CUP Image / ISO

Configuring Oracle 12c backups on Veritas Backup Exec 16.

CUCM 11.5 - Esxi 6.5 - unable to create VM