Bringing military-grade cybersecurity solutions to the enterprise and critical systems.
Telephone: 310.356.7869

NetBeans 6 is cool

Category: Java

1:24 PM, Thu, Dec 6 2007

NetBeans 6 FCS (First Customer Shipment) came out on December 3rd. I've been using it since Release Candidate 1 came out a few weeks previously. There are many reviews on various blogs, and I'm not going to do a review of it here, but rather focus on one small, cool feature of NB6. (Note that this feature did exist in NB 5.5; I'm highlighting it because I think it's one of those touches that make the whole product so natural to work with.)

Auto-implementation of abstract classes and interfaces is one of those ways where it leaps in and helps in just the right way. Create a class that extends or implements an abstract class or interface:

NetBeans IDE example 1

The class shows as having an error, because it is not implementing a required method of the AbstractAction abstract class. Click on the small lightbulb icon: NetBeans lightbulb icon.

NetBeans IDE example 2

Click on the NetBeans click here to implement abstract methods "implement all abstract methods" tooltip, and NetBeans gives you:

NetBeans IDE example 3

AbstractAction has only one abstract method, so the time savings isn't big. However, this method prevents mistakes, and in other abstract classes and interfaces which might have a dozen or more abstract methods, the time savings is big. Imagine needing your own implementation of a class like java.util.Set, which requires thirteen abstract methods. This feature of NetBeans would be a real time-saver, and programmer-sanity-saver, by creating all the necessary methods with the correct signatures, with one click.

By the way, the many reviews of NB6 have all been positive, and my experience with it has also been entirely positive. It's faster, more natural, and it provides help in those little ways that make things easier. I hope that, by illustrating this one small feature, you'll be inspired to try it out if you haven't already. Oh, and I should mention that NetBeans is not just for Java. It is also a good development environment for C/C++, Ruby and other languages. And it's free, written in pure Java, and open source.