David has posted 1 posts at DZone. View Full User Profile

David Heffelfinger: My Five Favorite NetBeans IDE Features!

01.31.2014
| 6687 views |
  • submit to reddit

Continuing a series of articles focusing on NetBeans users and their five favorite NetBeans IDE features, here's the next part, by David Heffelfinger -- NetBeans team.

David Heffelfinger is the Chief Technology Officer of Ensode Technology, LLC, a software consulting firm based in the greater Washington DC area. He has been architecting, designing and developing software professionally since 1995 and has been using Java as his primary programming language since 1996.

He has worked on many large scale projects for clients including the US Department of Homeland Security, Freddie Mac, Fannie Mae, and the US Department of Defense. He has a Masters degree in Software Engineering from Southern Methodist University. David is editor in chief of Ensode.net (http://www.ensode.net), a website about Java, Linux, and other technology topics. He's also a published author with several books available at PACKT, as well as a screencast course on Java EE 7. He's currently working on a new book about Java EE 7 and NetBeans IDE 8.

What are your 5 favorite NetBeans IDE features?

1. Distraction Free Mode. This is a simple feature, but makes your life so much easier when you are working on a small screen. NetBeans IDE is very powerful, and by default it has a toolbar with several icons near the top of the screen, plus several windows open, the Projects, Files, and Services window on the left, the Navigator window, the Output window at the bottom, plus the main editor area. This is great when working with a large monitor, since there is a lot of information that can be gathered at a glance, and a lot of functionality that can be accessed by a simple mouse click.

However, when working with a small screen, such as a laptop screen, it can get cramped. The distraction free mode introduced in NetBeans IDE 7.4 takes care of this issue, just hit Ctrl+Shift+Enter (or select the editor and then choose View | Show Only Editor in the main menubar) and the current window will be maximized inside the IDE, hiding all other windows.


It now has the look and feel of a text editor, with the power of an IDE!

2. JPA Generation. This is not a new feature, but still a great time saver. I work as a consultant for different customers, and not all of them have adopted NetBeans IDE as their standard IDE. However, I’ve converted more than a few to NetBeans IDE by showing them this feature alone.

3. PrimeFaces Integration. NetBeans IDE has had the ability to generate JSF CRUD applications for a long time. This feature allows us to quickly generate web based applications from a set of database tables. The generated pages, however, were fairly simple looking.

In NetBeans IDE 8 the ability to generate CRUD applications using PrimeFaces was added. The generated PrimeFaces pages are very aesthetically pleasing.

4. Maven Integration. Maven tends to generate strong opinions among Java developers, it seems that you either love Maven or hate it. I happen to fall into the first camp. Again, being a consultant, I don’t always get to work with teams that have standardized in NetBeans IDE, so I’m always glad to find out the project I’m working on uses Maven, since all three major IDEs support Maven to some extent, making the project IDE independent.

NetBeans IDE Maven support is head and shoulders above other Java IDEs, it is very seamless, just open any random Maven project and NetBeans IDE takes it from there, it figures out all the dependencies, and the IDE menu items (Clean, Build, Run, etc) automatically invoke the appropriate Maven goals.

Additionally, when adding dependencies, I frequently remember the name of a class I need, but I seldom remember the Maven coordinates for the dependency. NetBeans IDE allows me to search the Maven repositories for the class I’m looking for.

5. Java EE Application Server Integration. NetBeans IDE seamlessly integrates with most popular Java EE application servers and servlet containers such as GlassFish, Wildfly/JBoss, Tomcat, TomEE, and Weblogic.

When I join a new project, chances are the application server the customer is using seamlessly integrates with NetBeans IDE. Not having to leave the IDE to start or stop the server or to deploy the code is very nice.

Bonus Feature: Other IDE KeyMaps. I’ve often demoed NetBeans IDE projects and developers not familiar with NetBeans IDE are sometimes impressed by its features, such as the seamless Java EE application server integration, Maven integration, and JPA generation capabilities.

However, some of these are long time users of other IDEs and have memorized the keyboard shortcuts of their current IDE, so they are hesitant to migrate because they don’t want to have to learn a whole new set of keyboard shortcuts.

A very nice feature is that NetBeans IDE comes with keymaps for the two other popular Java IDEs out of the box, so all of these developers have to do is set the keymap to their IDE of choice and they are good to go:

Do you also want to share your favorite NetBeans features with the world? Write to netbeans dot webmaster at gmail dot com.

Published at DZone with permission of its author, David Heffelfinger.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Anton Arhipov replied on Fri, 2014/01/31 - 8:07am

"Maven support is head and shoulders above other Java IDEs"

Could you please be more specific? Otherwise, everything you listed is available in other IDEs as well.. and works seamlessly.

Geertjan Wielenga replied on Fri, 2014/01/31 - 8:48am

One aspect of the NetBeans Maven support that is awesome and unique is that NetBeans doesn't throw NetBeans files into your Maven project structure just to make it a NetBeans project. Nothing is added at all. The Maven project you open into NetBeans is the same project that you close, no extra stuff that you don't really need, no stuff to worry about whether to check into versioning or not, no fuss. The POM is the entire project structure and NetBeans is smart enough to need to only work with that file.

By the way Matti from Vaadin says the following (here) very recently on Eclipse/NetBeans in relation to Maven: "From what I have learned, NetBeans excels at least in Maven support and JPA features."

Geertjan Wielenga replied on Fri, 2014/01/31 - 8:49am

And are you saying that you're able to create, out of the box, without any plugins, a PrimeFaces application in the other IDEs too? Aside from that, note that David didn't say that these features don't exist in other IDEs. He simply said what he appreciates about NetBeans.

David Heffelfinger replied on Fri, 2014/01/31 - 10:15am in response to: Anton Arhipov

 When working on Maven projects with other IDE's, IDE specific artifacts need to be created.

When making changes to Maven's pom.xml, these IDE specific artifacts need to be recreated to keep them in sync.

NetBeans IDE simply reads the pom.xml directly, any changes to the pom are picked up by NetBeans immediately.

Also, like I mentioned in the article, searching the Maven repositories and automatically adding dependencies to the pom with a click of the mouse is a great time saver.

Anton Arhipov replied on Fri, 2014/01/31 - 10:59am in response to: David Heffelfinger

I'm being picky about the strong statement without evidence - "head and shoulders". Not generating a project specific artifacts. Yes, it is nice, but... I was thinking about it...  Generating project-specific artifacts doesn't take enormous amount of time, so is it really a huge time saver? C'mon, it is the 21st century already :) 

I would agree that Eclipse used to do strange things, but those ages are gone and it is improving nicely (at last). I don't have to tell you about IDEAs support for Maven.. it has been outstanding since version 9.

IMO, Maven support used to be a differentiating feature... 5 years ago. Not any more.

Anton Arhipov replied on Fri, 2014/01/31 - 11:01am in response to: Geertjan Wielenga

And are you saying that you're able to create, out of the box, without any plugins, a PrimeFaces application in the other IDEs too?
Never said that. I'm only pointing to the statement about Maven support.

Anton Arhipov replied on Fri, 2014/01/31 - 11:04am in response to: Geertjan Wielenga

no stuff to worry about whether to check into versioning or not
I was writing about it in my blog and while I totally support the idea about not having the project files in version control, there are teams whose requirements might be the opposite.

Geertjan Wielenga replied on Fri, 2014/01/31 - 11:11am in response to: Anton Arhipov

 Oh, I see, sorry. I thought that when you said this that it referred to everything in the article -- but now I see it referred to the Maven point only -- " Otherwise, everything you listed is available in other IDEs as well.. and works seamlessly."

Geertjan Wielenga replied on Fri, 2014/01/31 - 11:13am in response to: Anton Arhipov

I think everyone knows that the Eclipse support for Maven is not so great. (Even Max said that during our JavaOne session.) So, between NetBeans and Eclipse, Maven is a BIG differentiating feature. Really, this is a key reason why people have been switching from Eclipse to NetBeans.

Geertjan Wielenga replied on Fri, 2014/01/31 - 11:27am in response to: Anton Arhipov

There's not been a single user of Maven in NetBeans IDE who has ever said: "I wish NetBeans would create artifacts in my source structure to enable it to recognize my source structure as a Maven project."

Anton Arhipov replied on Fri, 2014/01/31 - 11:40am in response to: Geertjan Wielenga

Kepler isn't that bad any more. It could do better, agree.

Anton Arhipov replied on Fri, 2014/01/31 - 11:44am in response to: Geertjan Wielenga

In most cases, I think, users don't realize if the artifacts are created or not. What I'm thinking about is the project specific settings such as formatting, etc. That's what I've been told. Well, perhaps in case of other IDEs there is a use case for that.

Charles Simon replied on Mon, 2014/02/03 - 6:01pm in response to: Anton Arhipov

IMHO.  The creation and maintenance of extra IDE specific files becomes a problem when you have developers using different IDEs on the same project.  It just leads to unnecessary clutter.

The IDE must notice when the pom.xml file has changed and then regenerate the extra files.   If the IDE does not automatically keep up with changes to the pom.xml then the developer has to remember to do something and that can lead to problems, which are totally unnecessary.

Bottom line: Why are they needed if the IDE rescans the pom.xml when it changes.  These settings should be kept in memory by the IDE and not stored externally.

Geertjan Wielenga replied on Mon, 2014/02/03 - 6:55pm in response to: Charles Simon

 That's exactly right and exactly why NetBeans is totally awesome.

Anton Arhipov replied on Mon, 2014/02/03 - 7:45pm in response to: Charles Simon

So why isn't it stated in the article? The problem here is that the article doesn't bring up any distinguishing _features_  for Maven support and makes a strong statement. 

Geertjan Wielenga replied on Tue, 2014/02/04 - 12:05am in response to: Anton Arhipov

Here's the feature being referred to in this discussion -- "just open any random Maven project and NetBeans IDE takes it from there, it figures out all the dependencies, and the IDE menu items (Clean, Build, Run, etc) automatically invoke the appropriate Maven goals".


In other words, there's no import process, there's simply a question of opening a folder that contains a POM, because no special files need to be created.

Basil Bourque replied on Wed, 2014/02/12 - 1:35am

 Several of the screenshots fail to load.

Stephen Lindsey replied on Fri, 2014/02/14 - 10:42am in response to: Anton Arhipov

 "5 years ago. Not any more."

Sorry that's just incorrect.

Five years ago  the support of Maven in Eclipse was next to non-existant (even 2 years ago it was poor). I used eclipse from the very first days (even when it was ibm something) i changed because of Maven 18 months ago and have never even considered going back.

Venkat Akkineni replied on Fri, 2014/02/14 - 7:19pm in response to: Anton Arhipov

To start with, thankyou for JRebel, it makes java developer's life easy. 

I agree with the "head and shoulders" statement. I get to use IntelliJ at work because my employer paid for it and they want everybody using the same tool. But I would go back to Netbeans in a heartbeat. Here are the maven related netbeans features that I just love. 

  • Netbeans recognizes the directory with a pom as maven project. Open the project and you are in business. No more setup.
  • One source of truth a.k.a pom.xml. Not one for command line build, one of ide build one for me, one for you and one for everybody else. 
  • Project specific settings files which allow one to be granular with maven settings.
  • Make maven goals available in project context menu.
  • Open all the modules or only the modules you are currently working on.  
  • Search for dependencies.
  • No IDE configuration files.
  • One click download of source jars and javadoc jars. IDE automatically recognizes these and bingo you can now click through the code.
  • Dependencies are listed in groups of scope in the project window. 
Generating project specific artifacts is not always trivial. More often than not somebody actually needs to guide one through the process.
So, I disagree with the statement " Maven support used to be a differentiating feature... 5 years ago. Not any more.". Even today, IntelliJ or Eclipse do not even come close to netbeans in this area. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.