Eclipse Netbeans Keyboard Shortcut Mapping for Java programmer

If you are a Java developer who has been using Eclipse for Java development, but you need to use Netbeans for your current project due to various reason,, then this article is for you. Whenever we transition between tools, we need the equivalent of one into other. For example, if you are Eclipse power user who is used to Ctrl + Shift + R and Ctrl + Shift + T then as soon as you start using Netbeans, you miss those shortcut. One thing to keep your productivity up is to quickly find the equivalent shortcut in a new tool, e.g., in Netbeans if you are switching from Eclipse or vice-versa. In this article, I am going to share the Netbeans equivalent of 10 useful Eclipse shortcuts for Java developers. You will benefit if you have to use any of these IDEs.

Eclipse Netbeans Keyboard shortcuts Mapping for Java Developers

1) Searching for a Class
In eclipse, we use Ctrl + Shift + T to search for a Type in the workspace, e.g., a class, an interface, or an enum. In Netbeans, you can use Ctrl + O to go to a Type. You can open a class from JAR file by using this shortcut. You will see the source code in Eclipse if the source is attached to JAR file, if not you can follow steps given here to set up that.

2) Searching for a File
In Eclipse IDE, we use Ctrl + Shift + R to search any resource, e.g., Java file, XML file, or a SQL file. The Netbeans equivalent of this shortcut is Alt + Shift + O, the go to File. You can use this shortcut to open any file from Netbeans projects.

3) Importing Java classes
One of the most used shortcut by Java programmers is importing classes. In Eclipse, we use Ctrl + Shift + O or Organize import to import missing classes, interface and enums. In Netbeans, the equivalent shortcut is Ctrl + Shift + I, Fix All imports. Similar to Eclipse's Organize import it also removes unused imports from the Java source file, if you have checked the remove unused import checkbox, by default, it's checked.

4) Finding all occurence of a method call
Netbeans - Find usage Alt +F7
Eclipse - Ctrl + Shift + G , also known as Search, just select the element and enter Ctrl + Shift + G

5) Rename a Class or Method
In Eclipse - Alt + Shift + R, select a method and enter this shortcut to rename the method, or select a class and enter this shortcut to rename a class.

In Netbeans - Ctrl + R, just select a member, method or a class and hit this shotcut to rename it. Netbeans will find all its occurence and update the name accordingly.

6) Show hints 
In Eclipse - press Ctrl + 1 known as a quick fix
In Netbeans - alt + enter

7) Close the current file
Ctrl + W work in both Eclipse and Netbeans

8) Formatting code
In Eclipse, select all code and press Ctrl + Shift + F
In Netbeans, select all code and press Alt + Shift + F

9) Commenting lines of code
NetBeans - Select all the lines and press Ctrl + / to remove, select them again and press the same shortcut
Eclipse - the Same shortcut works fine, you can also use Ctrl + Shift + / to insert a block comment.

10) Content assist
Ctrl + Space works in Netbeans as well as in Eclipse, also known as auto-completion in Netbeans world.

And, here is full list of Eclipse shortcuts for Java programmers:

Eclipse Netbeans Keyboard Shortcut Mapping for Java programmer

That's all about some useful shortcuts for Java programmer for Netbeans and Eclipse IDE. Knowing these shortcuts will save a lot of time while coding Java in both Eclipse and Netbeans. I mostly stick to Eclipse but sometimes Netbeans also provide a lot of help.

Further Learning
The Complete Java Masterclass
Java Fundamentals: Collections
Data Structures and Algorithms: Deep Dive Using Java

Other Java Articles you may like to explorer:

Thanks for reading this article so far. If you like this article then please share with your friends and colleagues.

No comments:

Post a Comment

Feel free to comment, ask questions if you have any doubt.