This post will cover how to use Dreamweaver like snippet feature in the Netbeans IDE. I recently found out about Dreamweaver snippets and fell in love with them.
First off “Snippets” in Netbeans are called “Code Templates” but I will use the two terms interchangeably. *NOTE* The one thing I wish Netbeans did have is drag and drop access to it’s snippets. Dreamweaver has this functionality and I find it very useful.
Let’s go setup your first Netbeans Code Template.
Go to “Tools-Options”.
Then go to “EDITOR – Code Templates”. Make sure you specify the programing language you want to the template to be valid in. I’ve selected HTML in our case.
Click “New” button. After you do that window will popup. It will ask you what you want to type to use the code snippet. I chose “form”. Hit Ok.
You should now see “form” has been created. You must now enter the code that you want to be automatically displayed when you type “form”
Fill out the code you want to use.
Make sure to note what the “Expand Template on:” key is. In my case I select “Tab”.
Hit OK.
Now try it out.
In the body of the HTML document type “form” and then hit the TAB key. Voila! Instant form with barely any coding at all! 🙂
For some extra reading you might like this as well: Netbeans Code Template Module Tutorial
Leave a Reply