Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
227 views

How To Create A Java Program Using NetBeans

1. The document provides step-by-step instructions for creating a first Java program using NetBeans IDE. It describes how to create a new project, add Java files to it, run the files and correct errors. 2. Users are asked to copy sample Java files to the project, run the files to get results, take screenshots of the outputs, and correct logical errors in one of the files so it calculates taxes and totals correctly. 3. Screenshots and examples of running the sample programs successfully are to be added to a Word document along with the corrected Java file to demonstrate understanding.

Uploaded by

Akash Patel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
227 views

How To Create A Java Program Using NetBeans

1. The document provides step-by-step instructions for creating a first Java program using NetBeans IDE. It describes how to create a new project, add Java files to it, run the files and correct errors. 2. Users are asked to copy sample Java files to the project, run the files to get results, take screenshots of the outputs, and correct logical errors in one of the files so it calculates taxes and totals correctly. 3. Screenshots and examples of running the sample programs successfully are to be added to a Word document along with the corrected Java file to demonstrate understanding.

Uploaded by

Akash Patel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

How to Create your first Java program using NetBeans.

1. Double click the icon “NetBeans IDE 8.2” on your windows


desktop. This will invoke the NetBeans Integrated Development
Environment (IDE).

2. Click the “File” menu choice and then select “New Project”. This
brings up the dialog box for creating a new project.
3. Select “Java” and then select “Java Application”. Click “Next”.
This brings up your project configuration dialog box. Enter “Project
Name” and “Project Location”. Un-Check both the “Create Main
Class” and “Set as Main project” check boxes. Then click “Finish”.

Note: Remember your “Project Location”. You may


need to copy files to it later.

4. Click the “Finish” button, you have created a new project:


5. Copy the given file, “Pay.java”, to the project “src” directory (in the
screen shot above, find “Project Location” and the “src” directory
under it):

6. NetBeans will automatically refresh, and the source code will show:
7. Right click the “Pay.java” and select “Run File”:

8. Try to enter data and get the running result:


9. Take a screen shot by clicking the “ALT” and “PRTSC” keys
together, open a word document, paste the screen shot to it. Note: Be
sure to show the result on the screen shot. You should run at least 3
different test cases with the working hours >, ==, and < 40 hours.

10. Now you can copy the “SalesText.java” file into the src directory:
11. You can check the NetBeans project refreshed screen:

Notice the red dot on the file “SalesText.java”. The red dot indicates
that this file has one or more syntax errors:
You can edit the source file by double click “SalesText.java”. It will
show you the error with a red wavy underline. Try to modify the file
and save it (from menu File -> Save) until the errors are all solved:

Right click “SalesText.java” and select “Run File”, and enter data:

Correct the logical error(s) in the “SalesTax.java” file. Make sure


the Total is the correct amount (The given source code does not
produce the correct Tax and Total value).
Take a screen shot by clicking “ALT” and “PRTSC” keys together,
then open a word document, paste the screen shot to it. Add screen
shots for at least two (2) successful and correct executions of the
“SalesText.java” program.

You can refer to the “How to Package a NetBeans Project”


document in the “Course Documents” section of the course for
detailed instructions on how to package a NetBeans project.

You can refer to the “How to Submit Assignments” document in


the “Course Documents” section of the course for instructions on
how to name and submit Lab Assignments and Programming
Projects.

You might also like