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.