Create Your Own Shortcuts In Netbeans

Hello All,

Here is the tutorial of how to create your own shortcuts in Netbeans. So let’s take an example to show.

Let’s create a shortcut for Even Odd Program:-

        java.util.Scanner s = new java.util.Scanner(System.in);

        int num;

        System.out.println(“Enter a number”);

        num = s.nextInt();

        if (num % 2 == 0) {

            System.out.println(“Even number”);

        } else {

            System.out.println(“Odd number”);

        }

 

So, click

  1. Run Netbeans
  2. Tools -> Options , it will show a window like this

 

a1

 

a2

 

a3

 

a4

 

a5 - Copy

 

Here I have used  eo  as abbreviation

 

a6

 

Put following code here :-

 

 java.util.Scanner s = new java.util.Scanner(System.in);

        int num;

        System.out.println(“Enter a number”);

        num = s.nextInt();

        if (num % 2 == 0) {

            System.out.println(“Even number”);

        } else {

            System.out.println(“Odd number”);

        }

a7

 

a8

 

a9

 

Finally, run it

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s