How to Make a Program in NetBeans
NetBeans is an Integrated Development Environment (IDE) designed to make the process of writing applications simpler. The IDE, available at no cost from NetBeans.org, contains a built-in editor, debugger and compiler. While it is specifically designed for Java development, plug-ins are available to support software design in C/C++ and PHP as well. At first glance, the IDE interface may appear confusing. The best way to get familiar with the NetBeans development environment is to go through the process of building a few basic programs.
Instructions
-
-
1
Open the NetBeans IDE, and click “File” on the main menu bar at the top of the program window.
-
2
Click “New Project” in the drop-down menu to open the new project window.
-
-
3
Click the “Java” entry under “Categories” in the “Choose Project” pane. Click “Java Application” in the “Projects” pane, then click the “Next” button at the bottom of the pop-up window.
-
4
Enter a name for your program in the “Project Name” text box. Leave the remaining entries as they are to accept the default folders and program creation options. Click the “Finish” button at the bottom of the pop-up window.
-
5
Examine the template code NetBeans generates for your application. The IDE’s main pane displays the code template. The upper-left pane displays the packages and libraries needed for compiling your code and the pane in the lower left displays the member classes included in your program.
-
6
Replace the commented line “//TODO code application logic here” with functional code. In this case, print a simple message to the screen with the output statement:
System.out.println(“I just wrote a program.”);
-
7
Save the project file by clicking “File” in the main menu bar and clicking “Save” in the drop-down menu. By default, NetBeans compiles your code each time it is saved.
-
8
Test your compiled project by pressing the “F6” function key on your keyboard. The program’s output displays in the window below your source code.
-
9
Build your application for deployment by clicking “Run” in the main menu. Click “Clean and Build Main Project” in the drop-down menu. This selection creates an executable .jar file in your development directory.
-
1
Tips & Warnings
Beginning with version 7, the NetBeans IDE no longer support development in Ruby. NetBeans 6.9.1 is the last version of the IDE to offer Ruby support.