Monday, June 15, 2009

Using NetBeans

Now we try to do our program with a more complicated way, let we see h
ow all the processes that have been described in the section previously using an application. In the lesson, we will be using NetBeans, which is the Integrated Development Environment or IDE. IDE is a scope programming that is integrated into a software application that provides a GUI builder, a text or code editor, a compiler or interpreter and a debugger.

Step 1: NetBeans
There are two ways to run NetBeans. First write the command to use terminal, or simply by clicking on the shortcut button that can be found in desktop.To run NetBeans using the command-line. Open a terminal (see steps on how to run the terminal didiskusi before), and type:
netbeans.


Second way to run NetBeans, is to click the shortcut icon there on your desktop.



Once you open the NetBeans IDE, you'll see a graphical user interface (GUI) as shown below.




Step 2: Create a Project

First, let's create a project. Click on File-> New Project. After do so, a dialog box will display the new project. Then click on Java Application and click NEXT.


Now, a new application dialog will be displayed.


Try to change the location of the application, by clicking on the BROWSE button. Then the dialog will show the location of project. Double click on your home folder.

Then the contents of the root folder will be displayed. Then double click on the folder MYJAVAPROGRAMS and click OPEN.

See Project Location and Project Folder has been changed to / home / florence / MYJAVAPROGRAMS. The latter, on the Create Main Class textfield, write Hello as the main class name, and then click Finish.


Step 3: Write in a Your program
Before you write a program, the first will be described on the main window after creating project. As shown below, automatically create NetBeans code base for your Java program. You can add statements in your code that has been generate. On the left side of the window, you can view a list of folders and filefile NetBeans generated after creating a project. All this you can
MYJAVAPROGRAMS find in your folder, where you specify the location of project it.


Now, try to modify the code generated by NetBeans. At this time ignore other parts of the program, details of the code will be described in the next section. Enter code:

System.out.println ( "Hello world!");

After the statement, / / TODO code application logic here.


Step 4: Compile your program

Now, to compile your program, click on the Build-> Buid Main Project. Or, you can also use the shortcut button to compile your code.
If there is no error in the program, you can see a build successful message in the resulting window.



Step 5: Running Your Program

To run your program, click on Run-> Run Main Project. Or you may also can use the shortcut to run your program.
Results from your program displayed in the window.


No comments:

Post a Comment