Netbeans

Introduction
Netbeans is a free, open-source Integrated Development Environment for software developers. You get all the tools you need to create professional desktop, enterprise, web, and mobile applications with the Java language, C/C++, and Ruby. NetBeans IDE is easy to install and use straight out of the box and runs on many platforms including Windows, Linux, Mac OS X and Solaris.

Links

 * Netbeans Website
 * Documentation
 * Plugin Portal

Configuring NetBeans 6.x.x
In order to improve the development you have to change some settings in Netbeans.

IDE language
If you want to change the IDE language of Netbeans set the locale parameter according to the language that you want to use before running the IDE.

Example: "E:\Program Files\NetBeans 6.0.1\bin\netbeans.exe" --locale en

Templates
To modifiy the template to generate Java classes do following:


 * 1) Choose Tools > Template Manager.
 * 2) In the Template Manager, expand the appropriate category node and select the template. For example, in the category Java, select Java Class.
 * 3) Click on the button "Open in Editor".
 * 4) In the Source Editor, make the desired changes to the template.
 * 5) Choose File > Save from the main menu.

You can use some FreeMarker variables and functions. Some common variables are:

${user}, ${date}, ${time}, ${name}, ${extension}

You can use your own variables writing them in the file User.properties. This file is located in the category "User Configuration Properties" of the Template Manager.

Margin Identation
Choose Tools->Options->Editor->Indentation and change the right margin to 120.

Main Shortcuts
Choose the option Windows->Keyboard Shortcuts Card to see all the main shortcuts used in Netbeans.

Tips:
 * In the German keyboard you have to press CTRL+SHIFT+C to (un)comment the lines.
 * CTRL+E delete a line.
 * Add the shortcut CTRL+ALT+A to "Apply Source Changes", when debugging the code. This option is very important and enables Netbeans to compile the source code "on-the-fly".

Importing Netbeans Libraries
If you had another Netbeans and created own libraries, you can import/migrate them to your new version of Netbeans or to another computer. Just follow the instructions below.


 * Copy all the XML files under the directory to the correct directory on your computer.


 * Restart Netbeans.

Subversion
In oder you can use subversion, you have to install the Netbeans plugin CollabNetSubversion.

Jasper Reports
In order to use iReport for Jasper Reports you have to download and install the iReport plugin.

JDKHOME not found
If you are getting an error message "jdkhome not found ..." everytime you start Netbeans because you upgraded your JDK to the latest version, you have to do follow the instructions below:


 * 1) To solve the problem edit the file.
 * 2) Change the property netbeans_jdkhome to point to the correct JDK directory.

Ready! Now you should not see this message after starting Netbeans.

Invalid ResourceMap in the Swing GUI
If you created a new project based on Swing Application Framework and would like to create more than one SingleFrameApplication class, you are in trouble, because Netbeans will not be aware what is the right class you want to use to update a GUI or create a new GUI (JFrame, JDialog, JInternalFrame, JPanel, etc).

Every time you update a GUI, Netbeans generates automatically a code similar to the lines below and blocks the source code from user editing using the Netbeans IDE.

org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(br.mypackage.SwingApp.class).getContext.getResourceMap(GuiIconTray.class);

There are two solutions for this problem:

1) You have to edit and change the java file using an external editor and change the class br.mypackage.SwingApp.class to the right SingleFrameApplication class

2) You can edit the file of your project and change the tag :

 

From now on all the GUI classes will be based on the class you specified there.

Category : Java Category : Software