Making a Program in BlueJ

  1. Start BlueJ, which will give you this main project window:

  2. Select the Project Menu / New Project, which will open up the additional following window.  Use the top-middle pull-down list to select a directory, then enter a name for your project in the “File Name:” window.

  3. You should now have the following back in your main project window:

  4. Next select the “New Class” button at upper left.  It is a good idea to make this name the same as your project name.  Your window will now look like:



  5. Double-click on the “Temp1” rectangle inside the workspace.  This will open up a new window which will allow you to type in code.



  6. Replace the existing section of code called “sampleMethod” with one called main, so that it looks like:

    You could add many lines of code inside this main() method of you wish, such as multiple output statements.
  1. Click on the “Compile” button at upper left.  If there are errors, fix them.  If not, close the code window (or move it out of the way) so you are back to the main project window.  Right-click on the “Temp1” Object, and select the “void main()” entry to run your program.
     

  2. The results will show up on a terminal window, which will open up separately.

  3. Hints: