Java: NetBeans 4.1 IDE

NetBeans is a free, open-source, IDE which is available from Sun at www.netbeans.org. This is a reasonable choice, and liked by many programmers. It isn't as full featured as IntelliJ IDEA (expensive) or Eclipse (free), but it has other advantages: cheaper in the case of IntelliJ IDEA, and a reasonable GUI form editor, which Eclipse lacks (altho perhaps this has been added by now). Overall a good choice.

Immediate error messages. The most useful feature for students is the jagged red line put under erroneous statements when there's a pause in the typing. NetBeans continuously compiles the program as you're typing it to alert you whenever there's an error. It's like the continuous spell checking of some word processors. I've gotten so used to this feature that I feel uneasy when I use an editor that doesn't do it.

Indentation is a serious problem for beginning students. Just right click the source code and choose Reformat Code. It will reformat the entire file if nothing is selected, otherwise only the selected text.

Downloading NetBeans

The easiest way to intall NetBeans and the lastest version of Java is to go to java.sun.com/j2se/1.5.0/download.jsp and click the Download JDK 5.0 Update 3 with NetBeans 4.1 Bundle button. For some reason the combined Java+NetBeans bundle isn't available from the NetBeans site, www.netbeans.org, where you can download the two parts separately.

Tutorials

Go to www.netbeans.org for the most current documentation. Some of the articles you can find there are listed below.

Starting a new project in NetBeans 4.1

  1. Click New Project in File menu or Welcome window.
  2. Choose Category General, and Project Java Application. Click Next.
  3. The left panel now shows your project, and the right panel shows the source file.

Misc settings in NetBeans 4.1

Reasonable editor settings (line numbers and tab size)
To change editor settings.
To make comments print darker
Comments may print in such a light gray that they are unreadable. To change this.
Changing to generic, type-safe, data structures
When compiling a program that uses non-generic data structures, it's possible to accidentally add an element of the wrong type. To alert you to places where this might be a problem, add
Importing packages into a project

To use other packages (eg, com.fredswartz.fmt), NetBeans has to know where to find them. Here is the process.

Turning runtime assertion checking on

[TODO: There should be info/link here about how to make a runnable jar with assertions turned on.]

Making NetBeans load faster by disabling some modules
Take a look at NetBeans Startup Performance Tips for some good tips to improve startup time. Worked well for me.
NetBeans will generate getters and setters
See Generating Getters and Setters.

Console input fixed in NetBeans 4.1

Console input was broken in NetBeans 4.0, but has been fixed again in 4.1.