touque.ca > Education Commons > Java > Resources

BlueJ Summaries

Getting started

  1. To open a project, select Open from the Project menu.
  2. To create an object, select a constructor from the class popup menu.
  3. To execute a method, select it from the object popup menu.
  4. To edit the source of a class, double-click its class icon.
  5. To compile a class, click the Compile button in the editor. To compile a project, click the Compile button in the project window.
  6. To get help for a compiler error message, click the question mark next to the error message.

Doing a bit more…

  1. Object inspection allows some simple debugging by checking an object’s internal state.
  2. An object can be passed as a parameter to a method call by clicking on the object icon.

Creating a new project

  1. To create a project, select New… from the Project menu.
  2. To create a class, click the New Class button and specify the class name.
  3. To create an arrow, click the arrow button and drag the arrow in the diagram, or just write the source code in the editor.
  4. To remove a class or an arrow, select the remove function from its popup.

Using the code pad

  1. To start using the code pad, select Show Code Pad from the View menu.
  2. To evaluate Java expressions, just type them into the code pad.
  3. To transfer objects from the code pad to the object bench, drag the small object icon.
  4. To inspect result objects in the code pad, double-click the small object icon.
  5. Statements that are typed into the code pad are executed.
  6. Use shift-Enter at the end of a line to enter multi-line statements.
  7. Local variables can be used in single, multi-line statements. The names of objects on the object bench serve as instance fields.
  8. 20. Use up-arrow and down-arrow keys to make use of the input history.

Debugging

  1. To set a breakpoint, click in the breakpoint area to the left of the text in the editor.
  2. To single-step through your code, use the Step and Step Into buttons in the debugger.
  3. Inspecting variables is easyL they are automatically displayed in the debugger.
  4. Halt and Terminate can be used to halt an execution temporarily or permanently.

Creating stand-alone applications

  1. To create a stand-alone application, use Project: Create Jar File…

Creating applets

  1. To run an applet, select Run Applet from the applet’s popup menu.
  2. To create an applet, click the New Class button and select Applet as the class type.

Other operations

  1. Non-BlueJ packages can be opened with the Project: Open Non BlueJ… command.
  2. Classes can be copied into a project from outside by using the Add Class from File… command.
  3. Static methods can be called from the class’s popup menu.
  4. To generate documentation for a project, select Project Documentation from the Tools menu.
  5. The Java standard class API can be viewed by selecting Help: Java Standard Libraries.
  6. To create objects from library classes, use Tools: Use Library Class.

Source: Kölling, M (n.d.). The BlueJ tutorial, version 2.0.1 for BlueJ version 2.0.x. Mærsk Institute: Odense, Denmark. © M. Kölling.

touque.ca > Education Commons > Java > Resources

[This page last updated 2020-12-23 at 12h12 Toronto local time.]