
The BlueJ Tutorial Version 4.0 for BlueJ Version 4.x Michael Kölling King’s College London Copyright © M. Kölling Table of contents Contents 1 Foreword 4 1.1 About BlueJ ..............................................................................................................................4 1.2 Scope and audience ..................................................................................................................4 1.3 Copyright, licensing and redistribution ...................................................................................4 1.4 Feedback ..................................................................................................................................5 2 Installation 6 2.1 Installation on Windows ...........................................................................................................6 2.2 Using the Standalone package .................................................................................................6 2.3 Installation on MacOS .............................................................................................................6 2.4 Installation on Debian and Ubuntu ..........................................................................................7 2.5 Installation on other systems ....................................................................................................7 2.6 Installation problems ................................................................................................................7 3 Getting started – edit / compile / execute 8 3.1 The BlueJ Main Window ..........................................................................................................8 3.2 Opening a project .....................................................................................................................9 3.3 Creating objects .......................................................................................................................9 3.4 Execution ................................................................................................................................11 3.5 Editing a class ........................................................................................................................13 3.6 Compilation ............................................................................................................................13 3.7 Navigating compilation errors ...............................................................................................14 3.8 Viewing class documentation .................................................................................................15 4 Doing a bit more... 16 4.1 Inspection ...............................................................................................................................16 4.2 Passing objects as parameters ...............................................................................................18 5 Creating a new project 20 5.1 Creating the project directory ................................................................................................20 5.2 Creating classes .....................................................................................................................20 5.3 Creating dependencies ...........................................................................................................21 5.4 Removing elements .................................................................................................................21 6 Using the code pad 22 6.1 Showing the code pad .............................................................................................................22 6.2 Simple expression evaluation .................................................................................................23 6.3 Receiving objects ....................................................................................................................24 6.4 Executing statements ..............................................................................................................25 Copyright © M. Kölling 2 Table of contents 6.5 Multi-line statements and sequences of statements ................................................................25 6.6 Working with variables ..........................................................................................................25 6.7 Command history ...................................................................................................................26 7 Debugging 27 7.1 Setting breakpoints .................................................................................................................27 7.2 Stepping through the code ......................................................................................................29 7.3 Inspecting variables ...............................................................................................................29 7.4 Halt and terminate .................................................................................................................30 8 Creating stand-alone applications 31 9 Other operations 33 9.1 Opening non-BlueJ packages in BlueJ ...................................................................................33 9.2 Adding existing classes to your project ..................................................................................33 9.3 Calling main and other static methods ..................................................................................33 9.4 Generating documentation .....................................................................................................34 9.5 Working with libraries ...........................................................................................................34 9.6 Creating objects from library classes ....................................................................................34 10 Editor Tips and Tricks 36 10.1 Changing key bindings ...........................................................................................................36 10.2 Stand-out comments ...............................................................................................................36 10.3 Adjust editor preferences .......................................................................................................36 11 Just the summaries 37 Copyright © M. Kölling 3 1 Foreword 1.1 About BlueJ This tutorial is an introduction to using the BlueJ programming environment. BlueJ is a Java™ development environment specifically designed for teaching at an introductory level. It was designed and implemented by the BlueJ team at King’s College, London. More information about BlueJ is available at http://www.bluej.org. 1.2 Scope and audience This tutorial is aimed at people wanting to familiarize themselves with the capabilities of the environment. It does not explain design decisions underlying the construction of the environment or the research issues behind it. This tutorial is not intended to teach Java. Beginners of Java programming are advised to also study an introductory Java textbook or follow a Java course. This is not a comprehensive environment reference manual. However, it does cover a large portion of BlueJ’s functionality. Further information about particular features can be found in other documents, including the guide to Unit testing in BlueJ and the BlueJ Teamwork Tutorial, which are available from the BlueJ website. Every section starts with a one-line summary sentence. This allows users already familiar with parts of the system to decide whether they want to read or skip each particular section. Section 11 repeats just the summary lines as a quick reference. 1.3 Copyright, licensing and redistribution This tutorial is available 'as is', free of charge to anyone for use and non-commercial re-distribution. Disassembly of the system is prohibited. BlueJ is distributed under the GNU General Public License version 2.0 with Classpath Exception. The copyright © for BlueJ is held by M. Kölling and J. Rosenberg. Copyright © M. Kölling 4 Foreword 1.4 Feedback Comments, questions, corrections, criticisms and any other kind of feedback concerning the BlueJ system or this tutorial are very welcome and actively encouraged. Please mail to Michael Kölling ([email protected]). Copyright © M. Kölling 5 2 Installation BlueJ is distributed in five different formats: one installable package for Windows systems, one “standalone” (installation free) package for Windows, one for MacOS, one for Debian-based systems (including Ubuntu), and one for all other systems. All of these can be downloaded from the BlueJ website at http://www.bluej.org/. Installing it is quite straightforward. 2.1 Installation on Windows The distribution file for Windows systems is called Bluej-windows-xxx.msi, where xxx is a version number. For example, the BlueJ version 4.1.1 distribution is named BlueJ- windows-411.msi. Double-click the installer to launch it. The installer lets you select a directory to install to. It will also offer the option of installing a shortcut in the start menu and on the desktop. In general, you should accept the default choice for all options presented during installation unless you have reason to do otherwise. Once installed, you can launch BlueJ from the start menu or desktop icon, according to your choices during installation. The Windows installer includes a suitable Java JDK (development kit and runtime environment) for running
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages38 Page
-
File Size-