Tutorial 3
Tutorial 3
1234567
This tutorial will cover the steps to create a new project, learn the different parts of the
IDE, and learn how to edit code in Netbeans. We will code a simple Tutorial program to
demonstrate this. The Tutorial program will be used for the remainder of the tutorials,
so make sure you don't delete it once you are done with this tutorial.
Select File > New Project from the menu at the top
At the New Project screen, select General for Category, Java Application for the
Project and click the "Next" button
Name the project "Tutorial" and choose a location for it. Leave Set as Main
Project and Create Main Class checked.
The Main Class will be your "Driver" class. Always make sure to rename it
something that is not "Main". I prefer the name Driver.
o
When you are done, click the "Finish" button and move on to the next step.
Below is a screenshot of the Project window. You can use this window to see all
the files (classes) that make up your project.
o
NOTE: For every project, all of your files should always be in <default
package>. If they are in something else besides <default package>, you
have made a mistake in step 1.
Below is a screenshot of the Output window. This is the window you will look at
when you try to compile and run your program. It will display the same output
as what is displayed when you type "javac" and "java". Whenever you use the
Scanner class, you can use this window for input as well.
Below is the Code window. This is where you will edit all your source code. There
are buttons at the top for adding comments, and doing other useful tasks.
Lets write a simple program that will just print out the numbers 1 to 5. See the
screenshot below for the code snippet.
You can learn how to compile and run your program in the next tutorial.