Category Archives: netbeans


Here’s a good example of some bad user interface design in my favorite IDE.

I know the Maven stuff is a plugin, so I’m guessing NetBeans allows plugins to install tabs under “Miscellaneous”. So what you end up with is a configuration screen that looks simple until you find out that there are really supposed to be 30 tabs instead of 7, but they are hiding out in the Miscellaneous section.

Tabs vs spaces in Netbeans

I work with some people that like spaces and some people that like tabs in their code. I don’t really care, so I try to follow whatever the project is using. I ran into a big problem with Netbeans, though, in that it seems like getting it to use tabs only is impossible. It turns out they appear to be following a weird part of the Java Code Conventions spec:

Four spaces should be used as the unit of indentation. The exact construction of the indentation (spaces vs. tabs) is unspecified. Tabs must be set exactly every 8 spaces (not 4).

So, Netbeans sort of has two different “numbers” around tabs. There is a number that says how many spaces a tab should appear as, and a number that says how many spaces should be used when you indent something. By default a tab appears as 8 spaces, but a level of indentation is 4 (like the spec says above). As a result, it inserts four hard spaces when you indent one level, and a tab if you indent two levels. The solution is to set the two numbers to the same value. Just a wee bit confusing for a new user.

Here’s a bug report where someone describes it:

A couple of Netbeans issues

I think this is week 3 of Netbeans now, so I’ve used it a bit longer than planned. I found a couple of things that are annoying.

  • I miss the synchronize view in Eclipse. There is a simple “Show Changes” view that shows all of your subversion changes, but it isn’t hierarchical at all. I had to do a massive commit today, and it was very tedious selecting each file without being able to select whole directory structures.
  • It seems to hide certain project files from you, kind of like Visual Studio. For example, in one of my Maven based projects, I had a README.txt at the top level, and I can’t see it in the “Projects” view. If I go to the “Files” view, I can see it, but then I don’t get any other organizational stuff, like source folders.

The end of Netbeans week

I have finished my week of Netbeans usage and so far am pretty impressed. I was able to go all week without using Eclipse once. A large part of that is thanks to the fact that I’ve been using Maven 2 for a large number of my most recent projects. If you have a pom.xml, Netbeans will be able to check out your project and open it without you doing a single bit of configuration. This is great, since it goes a long way in preventing IDE lock-in. If you are working on a Maven project, you can use Netbeans easily, even if everyone else is using Eclipse. I didn’t get very deep into working on non-Maven projects, so that may have been quite a bit more hassle. All in all, though, Netbeans has come a long way since the last time I gave it a serious test. Here are some of my favorite features:

  • Autocomplete seems quite a bit faster than Eclipse
  • Maven integration is good, but I only briefly tried projects with parent-child relationships, which seemed to trip it up a bit
  • Adding getters/setters is a lot less hassle than Eclipse.
  • Using jetty:run right inside Netbeans was pretty easy, though it did require the use of external Maven, I’m not sure why.
  • The web.xml editor is pretty cool
  • It has a built in SOAP client, although it seems pretty clunky.
  • SVN integration seems complete and not very buggy. The interfaces are quick and simple, though I might say it’s a bit oversimplified from the way Eclipse does things.
  • The built in editor support for non-Java files seems less buggy than in Eclipse.

I may give Netbeans another week. It should be pretty obvious to anyone that it takes longer than a week to fully get a feel for such a complicated piece of software.