BlueJ is a program for introducing how classes and
objects (instances of a class) work in Java.
Netbeans is an independent development environment
(IDE) used by professional Java programmers.
Netbeans BlueJ is a version of Netbeans with a BlueJ
interface, so that students can move gradually from the
BlueJ interface to Netbeans.
Viewing an existing project
Download the following file to your Desktop:
Unzip the file.
Right click file
Open Netbeans BlueJ.
Open the 'calculator' folder on the Desktop as a
browse to the 'calculator' folder and
Open Project Folder
Projects (Netbeans) vs. BlueJ
Views of the same files
Classes with main methods (i.e.,
runnable classes) have green
triangles on them
To run programs/projects:
right click classes with green
triangles and select 'run file'
OR click 'run main project'
To compile individual files, right click and select
Classes that are out of date with their sources have
hatching on their icons (e.g., CalcEngine.java above).
To close a project:
BlueJ view: File
Netbeans: right click the project
Your first project
Give it a name, and select the folder where you
want the files to be stored.
Class with main method
Give it a name (first letter must be uppercase)
Insert your code in the main method. It creates
“Hello world” for you.
In pictures... “new project”
name the project
name the file
write your code
And if you mess up...
When you save the file, it will auto
compile behind the scenes, and attempt
to guess where you made errors.
Its guesses are marked with red X boxes
(see next slide).
Why might the guesses not be perfect? (hint:
the compiler interprets the code left
Let's see what happens if we forget to
capitalize the class name and leave a
semicolon off of a println() statement.