Robocode using Netbeans IDE
This tutorial aims to provide direction on how to configure NetBeans IDE in order to create robots and use them in Robocode. If you're looking to a tutorial on how to configure Eclipse you can find it at the Robocode's online help.
There is also a Portuguese version of this tutorial at the Portugal-a-Programar's Wiki.
It's easy to add IDE support to Robocode, in fact the developers of Robocode added both and editor and generic support for IDEs. But that support only allows Robocode to know where compiled robots, created with an IDE, reside to use them, it does not permit us to use the full features of an IDE and thus makes it no different from using a simple text editor.
So, what we are going to do is configure NetBeans so that it understands what Robocode is and allows us to access code completion features, easy compiling, documentation, etc.
In NetBeans IDE only global libraries can have source and documentation attached. A global library is a normal library, a Jar file, that has the particularaty of being registered in the IDE an not only in one project. This allows various project to added it without you needing to manually copy the jar file to every project folder. The only thing you need to worry about is that the jar file location doesn't change.
As Robocode's installation folder only changes if you uninstall and install it into a different place, the library we're going to add will always be at the same location.
Basic Configuration
We need to add robocode.jar as a global library. First open you IDE's library manager, Tools > Libraries.
Library manager

Then press the New Library... button and add a new library named Robocode1.6, keep it's type as Class Library, though there is no harm in changing it, it's just the category.
Press OK and you'll be presented with the option to add the Jar file, the source and the Javadoc for the new library you created. So, in the Classpath section, press Add Jar/Folder button, navigate to you Robocode installation directory, find the sub-folder libs, and inside it select the file robocode.jar. You can ignore any other Jar in that libs folder, only the robocode.jar is important as it is that file that contains the classes we need to develop robots.
New library with classpath filled

As with the Jar file, do the same for the source and Javadoc. The javadoc folder is a sub-folder of your Robocode installation folder. The source can be downloaded in the Robocode's download page. Add these item in the correct section, the source file in the Sources section and the javadoc folder in the Javadoc section.
Creating a Project
Create a Java project, without a main class, or any other class for that matter and add the global library we created before.
Context menu

Selecting our global library

After you press the Add Library button, create a simple class, as you would to create a robot, in this case I created the class Titan that does nothing else but exist :)
If you have added the Javadoc folder in the library configuration sections you will be able to access the documentation for the methods that a robot can use.
Javadoc inside the IDE
Making Robocode Aware of Your Robots
There are two different options to let Robocode know of your robots, one it to let Robocode know where the project's build folder is, the other is to make NetBeans IDE automatically copy each compiled robot to the robots sub-folder in the Robocode's installation folder.
I prefer a variant of the second option, but either one will do.
The Robocode Way
Access Robocode's options panel, Options > Preferences, click the Development Options separator and place your project's build folder in robots path.

The downside of this option is that Robocode will only see one robot at a time, and each time you create a new project you need to change this option.
Letting the IDE Take Care of the Robots
The second option also divides itself into two different ways. This option will let NetBeans IDE copy the robot files, after build or compile. I prefer after build, but that's just me :D
Add the following code to the end of the project's build.xml file so that NetBeans copies the robot classes to the robot sub-folder in your Robocode's installation folder.
<target name="-post-compile">
<copy todir="C:/Tools/Robocode/robots">
<fileset dir="${build.dir}/classes"/>
</copy>
</target>
Or this one so that, instead of the files inside the build folder, NetBeans copies the Jar file of your robot, with all the needed resources.
<target name="-post-jar">
<copy file="${dist.jar}" todir="C:/Tools/Robocode/robots/"/>
</target>
Both options in the end of the build.xml file
You can only choose one of the options, though it will work if you add them both, it will also create duplicated entries.
Please note that you must replace the path in the todir entry, so that it matches a folder in your system.
The downside of this approach is that you need to add the code to every build.xml file for every different project.

