CS 1073 Introductory Programming
for Scientific Applications
Getting Started with netBeans

  1. Start netBeans:
    1. Start button -> Java Compilers -> netBeans 3.6

  2. New Project (must pick a name for it, for example: mathematics):
    1. Choose Project > Project Manager.
    2. Click New, give the project its name (mathematics), and click OK.

  3. Folder for your project (must pick a name for it):
    1. Create any folder you like, say the following, where instead of wagner, use your own last name.
        C:\Documents and Settings\All Users\wagner
        
    2. Choose File > Mount Filesystem.
    3. Select the Local Directory node in the wizard that appears and click Next.
    4. On Select Items to Mount page of the wizard, use the folder you created in item 1 above.
    5. Select the folder (wagner) and click Finish.
      The wagner filesystem node appears in the Filesystems window. The filesystem's sources are added to the project classpath. Note: Don't navigate into the wagner directory. Just select the wagner directory and click Finish.

  4. New Package (must pick a name for it, for example: quadratic):
    1. Right-click the wagner directory node in the Filesystems window and choose New > Java Package.
    2. In the name field, type quadratic and click Finish.

  5. New Java class (must pick a name for it, for example: Quadratic):
    1. Right-click the quadratic package's node in the Filesystems window and choose New > Java Main Class.
    2. In the name field, type Quadratic and click Finish.

  6. Enter the Java program itself:
    1. At the ... point enter the following:
      
        double a, b, c;
        a = 3;
        b = 4;
        c = Math.sqrt(a*a + b*b);
        System.out.println("c = " + c);
        

  7. Compile the Java program:
    1. Choose Build > Compile.
      The Output window opens at the bottom of the IDE and displays any compiler output, including compilation errors. You can double-click any error to go to its location in the source code. (If you wish, you can skip this step and use "Execute" directly -- if the source is new or has changes, the system will compile automatically.)

  8. Execute the Java program:
    1. Choose Build > Execute.
      The IDE runs the program and prints the output to the Output window. You should see the following message in the Output window: "c = 5.0".


Revision date: 2004-08-31. (Please use ISO 8601, the International Standard.)