Main creation shortcut in NetBeans

Maybe You used Eclipse some days (and still use it ;)) and appreciate the way You can create the main method. In Your class, You enter “main” and then press Ctrl+Space and it generates the body of Your main method.
Using NetBeans, it isn’t available by default. But some times ago, I found a way to do it in the similar way that Eclipse does🙂 So let’s see how.

You have to create a code template, but don’t be affraid, it’s really simple. First go to the preferences of NetBeans, then in the “Editor” part and click on the tab “Code templates”. You should be there :

Then click on “New”. In the window, type the text You have to write. It’s Your shortcut🙂 For the main method generation, type “main”🙂 It’s not original but instinctive🙂
In the list, Your new abbreviation is selected. In the text area called “Expended Text”, enter this :

public static void main(String[] args) {
${cursor}
}

You’ve successfully created a main template🙂
Now in Your class, just type “main” and press the Tab button, and Your main body will be created🙂
It’s nice, it’s simple, it’s Java🙂
Enjoy