You are on page 1of 1

Computer Science (Advanced) Java Programming

NetBeans IDE: Getting Started


“NetBeans” is an IDE, an Integrated Development Environment (of which there are many other
equivalent products). The point of an IDE is to provide a working environment, in which you can write,
design, edit, compile, execute and debug programs. NetBeans is capable of supporting many different
programming languages, but it is particularly suited to the development of Java programs.
Projects
The most difficult feature for newcomers to NetBeans (or any IDE) is the concept of a “project.” A
project is simply a way of keeping together the source and other files that belong to one activity.
For courses like CSC-240 or CSC-241, the most convenient approach is to create a project for each
Lesson, probably called something like “Lesson1,” “Lesson2,” or “Assignment01,” “Assignment02,” etc.
The name of the project is a reference point just for you and does not affect anything else.
The instructions for creating new projects in the NetBeans IDE can be found in the accompanying article,
“FAQ NetBeans IDE: Creating New Project.” For other IDE's, consult the manual or help instructions for
that IDE. You should look at this article now.
Your New Project
Having started a new project, the new project is displayed in the “Projects” tab of the IDE.
You may wish to make this your “Main Project,” at least until you wish some other project to be the
“Main Project.”
To NetBeans, the “Main Project” is the project used by default for all the tool buttons on the top toolbar.
You can change your Main Project to this project or any other project at any time by selecting the icon or
name for that project, right-clicking, and then clicking on “Set as Main Project,” which is about half-way
down the menu.
In your project, you should see a number of nodes, the most important being the one labeled “Source
Packages” (using the one labeled “Libraries” will come later). This is where you create the Java source
files for the classes that you are going to write.

Within the “Source Packages” node you will see a <default package> node. This is the package-with-no-
name. In your file system, this is actually the folder called “src” within the folder for the project itself (the
Project Location that you noted above). For many projects, and certainly for the first few Lessons, it is
sufficient that your classes be created within the <default package>.
But you have a choice. You may create a package (or packages) if you wish. You do this by right-clicking
on the “Source Packages” node and selecting New => Java Package. A Java package name is usually
a sequence of lower-case names, structured by separating the names by dots. If you go to your Project
Location with your File browsing application, or select “Files” in NetBeans, and look inside the folder
called “src,” you will see the folders corresponding to the package structure. (More on this later under the
heading, Demonstration Programs).

You might also like