- To open a project, select
- To create an object, select a constructor from the class popup menu.
- To execute a method, select it from the object popup menu.
- To edit the source of a class, double-click its class icon.
- To compile a class, click the
Compilebutton in the editor. To compile a project, click the
Compilebutton in the project window.
- To get help for a compiler error message, click the question mark next to the error message.
Doing a bit more…
- Object inspection allows some simple debugging by checking an object’s internal state.
- An object can be passed as a parameter to a method call by clicking on the object icon.
Creating a new project
- To create a project, select
- To create a class, click the New Class button and specify the class name.
- To create an arrow, click the arrow button and drag the arrow in the diagram, or just write the source code in the editor.
- To remove a class or an arrow, select the remove function from its popup.
Using the code pad
- To start using the code pad, select
Show Code Padfrom the
- To evaluate Java expressions, just type them into the code pad.
- To transfer objects from the code pad to the object bench, drag the small object icon.
- To inspect result objects in the code pad, double-click the small object icon.
- Statements that are typed into the code pad are executed.
shift-Enterat the end of a line to enter multi-line statements.
- Local variables can be used in single, multi-line statements. The names of objects on the object bench serve as instance fields. 20. Use up-arrow and down-arrow keys to make use of the input history.
- To set a breakpoint, click in the breakpoint area to the left of the text in the editor.
- To single-step through your code, use the
Step Intobuttons in the debugger.
- Inspecting variables is easyL they are automatically displayed in the debugger.
Terminatecan be used to halt an execution temporarily or permanently.
Creating stand-alone applications
- To create a stand-alone application, use
Project: Create Jar File…
- To run an applet, select
Run Appletfrom the applet’s popup menu.
- To create an applet, click the
New Classbutton and select
Appletas the class type.
- Non-BlueJ packages can be opened with the
Project: Open Non BlueJ…command.
- Classes can be copied into a project from outside by using the
Add Class from File…command.
- Static methods can be called from the class’s popup menu.
- To generate documentation for a project, select
Project Documentationfrom the
- The Java standard class API can be viewed by selecting
Help: Java Standard Libraries.
- 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.
[This page last updated 2020-12-23 at 12h12 Toronto local time.]
© 2007–2021 Hersch, Bear & Company Limited. All rights reserved. “Grammar Authority,” “grammarauthority.com,” “touque.ca,” and “Canada’s Thinking Cap” are trademarks of Hersch, Bear & Company Limited. All other trademarks and copyrights are the property of their respective owners.