Professional Documents
Culture Documents
M255
This guide covers the installation and basic use of the BlueJ IDE and M255 course software.
4 Launching BlueJ 10
5 Using BlueJ 12
5.3 Opening Amphibian Worlds and Accounts World from within BlueJ 13
8 Keyboard shortcuts 31
8.1 BlueJ 31
8.3 OUWorkspace 34
2
1 Introduction
1.1 The course software
There are four different software components in the course, all of which are installed on your
computer during the installation process (Section 2):
1. Java – to run and develop Java programs you must have Java installed on your
computer. This is done during the first part of the installation process. It is helpful to be
aware of the distinction between the Java Development Kit (JDK) and the Java Runtime
Environment (JRE). If you only want to run Java programs you only need to have the
Java Runtime Environment installed on your computer. However, if you want to develop
Java programs, as you will be doing in M255, you must have the Java Development Kit
(also known as the Software Development Kit, or SDK) installed. Both the JDK and JRE
are installed by the M255 installer. In M255 you very seldom use Java commands
directly, however, in Unit 9 you do run some Java programs directly from the Windows
command prompt.
2. BlueJ – the integrated development environment used in M255. In M255 you do not use
all the features of BlueJ, but it provides a simple environment for developing and
documenting classes. Sections 4 (Launching BlueJ), 5 (Using BlueJ) and 7 (Editing
classes in BlueJ) of this guide describe those features of BlueJ with which you need to
become familiar. BlueJ was not developed at the Open University and you can find out
more about it at www.bluej.org.
3. M255 specific BlueJ projects – the BlueJ projects developed by the M255 Course
Team. You will investigate and extend these projects throughout the course.
4. The OUWorkspace – a general-purpose Java programming tool developed by the M255
Course Team. The OUWorkspace is launched from within BlueJ and can be used to write
Java code to create instances of any classes contained in the currently opened BlueJ
project, and to send messages to those objects. Any object created in the OUWorkspace
can also be inspected to view its current state.
3
2 Installing the course software
To install the software from this CD-ROM onto your hard disk, insert the CD-ROM into an
appropriate CD drive. An installation program should start automatically, but if the ‘autorun’
feature has been disabled then you will need to run the M255 set-up program on the
CD-ROM. To run the set-up program click on the Start button, then select Run…, next click
on the Browse button and navigate to the CD-ROM drive containing the CD-ROM. Here
select M255setup.exe (it may just appear as M255setup) and click the Open button. Finally
select the OK button.
The second screen of the installer is shown in Figure 1.
4
The final screen of the BlueJ installer is shown in Figure 2.
Figure 3 The message shown following the completion of the BlueJ installer
BlueJ is launched at this point so it that it can be configured to use the correct version of Java
(this process will ensure any previously installed older versions of Java do not cause problems).
When the OK button is selected a window similar to that shown in Figure 4 appears.
Figure 4 BlueJ Launcher window showing the Java SDKs present on a computer
5
M255 requires that you use Java 1.5 or above but Windows Vista users must
use Java 1.6 or above for everything to work correctly. We therefore strongly To change the version of
recommend that all users use Java 1.6 (or above), so you should select Java used by BlueJ after
(highlight) the Java 1.6.0_07 option and then select Launch BlueJ. Two things installation, see Subsection
4.1.
then happen and the order in which these happen depends on the speed of
your computer.
1 The BlueJ splash screen (Figure 5) will appear followed by the main BlueJ
2
The installer will display the window shown in Figure 7.
It is important that you do not respond to the installer window (Figure 7) until after you have
closed the main BlueJ window (Figure 6).
6
Figure 7 Message shown once the Java SDK for use with BlueJ has been selected
Once BlueJ has been closed, the OK button shown in the installer window (Figure 7) can be
selected. The prompt ‘Do you want to install the Java 1.6 documentation?’ will be displayed.
You should select ‘Yes’ and select all the default options. In particular, do not change the
destination folder for the Java 1.6 documentation as this is based on the Java 1.6 SDK you
have selected to use with BlueJ. The documentation will take some time to install.
Following the installation of the Java 1.6 documentation the installation continues without any
further prompts. Once the installation has finished you will see three new icons on your
desktop:
• BlueJ,
• M255
7
3 The Amphibian Worlds and Accounts World
applications
You can run certain M255 applications directly from Windows. In particular the
Amphibian Worlds (Units 1 and 2) and Accounts World (Unit 2) have been installed so that
you can open them from Windows easily.
The terminology ‘Select Start
3.1 Amphibian Worlds | Programs | M255 |
Amphibian Worlds’ means
To open the Amphibian Worlds application either select the Start button on the
• Double-click on the M255 Amphibian Worlds icon on the taskbar, then the Programs
option (or All Programs in
desktop
Windows XP) followed by the
or M255 program group and
finally the Amphibian Worlds
• Select Start | Programs | M255 | Amphibian Worlds option.
8
Selecting one of the Microworld menu options, opens the microworld in the current window.
The result of selecting the Two Frogs menu option is shown in Figure 10 (notice how all the
buttons are enabled so you can interact with the frogs).
or
• Select Start | Programs | M255 | Accounts World
9
4 Launching BlueJ
To launch BlueJ either double-click on the BlueJ icon on the desktop, or select
Start | Programs | BlueJ | BlueJ. Once BlueJ has opened, the main window is displayed
(Figure 12). The window is largely blank and the buttons disabled, indicating that a project is
not open. Before you can use BlueJ you must open or create a project (see Section 5).
10
4.2 Problem launching BlueJ?
There is a rare problem on some machines that means when BlueJ is launched the splash
screen appears (Figure 5), but when it vanishes the main BlueJ window (Figure 12) does not
appear.
To try to solve the problem you should launch the M255 Utility program using:
Start | Programs | M255 | M255 Utility
The window shown in Figure 14 will be displayed.
11
5 Using BlueJ
Project | Open Project…
5.1 Opening projects means select the Project
To open a BlueJ project use Project | Open Project… this displays a standard menu on the main BlueJ
file dialogue box to allowing a project to be selected. The first time you open a window, then select the Open
BlueJ project the file dialogue box is focused on the My Documents folder and Project… option.
you will have to navigate to the folder containing the M255 projects (the default
location is My Documents\M255\M255Projects). BlueJ remembers the folder of
the last project opened so the next time you open a project the file dialogue will
If you have used a project
be focused on that folder.
recently and you want to
The BlueJ’s file dialogues differentiate between standard Windows folders open it again you can use
(which have yellow icons) and folders which contain BlueJ projects (which have Project | Open Recent to list
brown icons of a slightly different shape). the last twelve projects
opened. To open a project
As an example consider Unit3_Project_1. This project is found in the folder you simply select it from the
M255\M255Projects\Block1 and to open the project: submenu.
• Select Project | Open Project… to open the Open Project dialogue
box.
• Identify the current folder. It will be given in the ‘File name:’ box.
• Navigate to the folder M255\M255Projects\Block1.
• Open the project Unit3_Project_1 either by double-clicking on the project or by
selecting (highlighting) it and clicking the Open button. The BlueJ window will be
similar to that shown in Figure 15.
Figure 15 The BlueJ window with the Unit3_Project_1 project open (and the Frog class
selected and the HoverFrog class displaying that it has been changed)
Please note that, if you are using Windows 98SE or Windows ME, when the project opens
a MSDOS command window (with the title Java) may also be opened. You should not
close this window (it will be closed when the project is closed) but you should either
minimise it, or simply make sure it is behind the other windows on your desktop.
12
The unlabelled icon is the project’s README file. You can open the README
file either by double-clicking on the icon, or by tabbing to the main BlueJ pane Using BlueJ’s keyboard
and using the cursor keys to move to the icon. Use the ENTER key to bring shortcuts is covered in
up the pop-up menu and select open. You can use the README file to make Section 8.
notes about the project. When you close the README file any changes you
have made to it are automatically changed and available the next time you
open the file.
The remaining icons correspond to the Java classes defined in the project: Frog, HoverFrog
and Toad. Class icons can have different visual appearances depending on the state of the
class. The icon representing the Toad class is the standard class icon.
5.3 Opening Amphibian Worlds and Accounts World from within BlueJ
If you launch BlueJ and open the Block1 project AmphibianWorlds you will find that the last
option on BlueJ's Tools menu (below OUWorkspace) is ‘Amphibian Worlds’. If you select this
menu option then the Amphibian Worlds application will launch in exactly the same way as if it
had been opened directly from the Windows desktop or the Start menu.
Similarly, if you open the Block1 project AccountsWorld you will find the last option on BlueJ's
Tools menu will be ‘Accounts World’. Selecting this option will launch the Accounts World
application in the same way as if it had been opened via the Windows desktop or Start menu.
13
When you open an application in this way BlueJ may still be the active window on the
desktop. In most cases the application window will be visible on the desktop and you just
need to switch to it. Sometimes the application window opened is hidden behind other
windows, so if you can’t see the application window, check the taskbar or use ALT+TAB to
cycle through the current windows.
Figure 20 The icon associated with the newly created class MyClass
14
The icon indicates that the class has been created but has not been compiled. Before the
class can be compiled it needs to be written, and to do this you will use the BlueJ editor (see
Section 7).
Adding an existing class
If you have an existing Java class (that is have access to the appropriate .java file) and wish
to use it in a BlueJ project you can add it to the project using the Edit | Add Class from File…
menu option. This option displays a file dialogue titled ‘Select Java Class to Add’ from which
you may navigate to the project folder containing the .java file of the class. By default this
file dialogue will only list .java files. Either double-click on the required .java file or
highlight it and select the Add button. A new class icon will appear in the BlueJ window
representing the newly added class. The icon indicates that the class has not been compiled.
Before you can use the class you must compile it (see below) even if you do not want to
change it.
15
navigate to a different folder to save the copy of the project. Enter the project name you wish
to use for the copy in the File name box and click the Save button. The project name should
start with an alphanumeric character and consist only of alphanumeric characters and the
underscore _ character. The new copy of the project will be opened. The icons representing
the classes will indicate that all the classes need compiling before they can be used.
16
5.11 BlueJ Help
The BlueJ Help menu includes a number of options, most of which you should not need to
use. The important ones for M255 are:
BlueJ Tutorial
This menu option opens the standard BlueJ Tutorial as distributed by the BlueJ developers.
This is a PDF file and to view it you must have Acrobat Reader installed (available on the
P559 Online Applications CD-ROM). Viewing this file is optional.
Java Class Libraries
This menu option will launch your web browser focused on the Java API (Application
Programming Interface) Specification (Figure 23). (The Java API is quite simply all the
classes, and their associated methods, which are available to programmers in the standard
Java development environment.)
Figure 23 Browser window showing the opening page of the Java Class Library
documentation
The most usual use of the ‘Java Class Libraries’ menu option is to find out the details of a
standard Java class. To do this select the class from the frame titled ‘All Classes’ and the
documentation for that class will appear in the main frame.
17
OU Class Library
This option will launch your web browser focused on the classes of the OU Class Library,
which are contained in a package called ou (Figure 24).
Please note that in Section 7 we mention that the documentation for a class can be viewed
in the BlueJ editor. However, for reasons explained in Section 7, it is recommended that
when you want to view the documentation for a class you generate the documentation from
the main BlueJ window and view it in a browser.
18
Figure 25 The documentation of the Unit3_Project_1 class produced using the
Tools | Project Documentation option
If the documentation for the project has previously been generated for the project you will see
the dialogue box shown in Figure 26. It is recommended that you select ‘Regenerate’ as this
will ensure that it accurately reflects the current versions of the classes in the project. If you
select ‘Just Show’ the existing documentation will be displayed, which may not include the
most recent changes to the classes. If your computer is rather slow and you know the most
recent changes to the classes do not affect its protocol then you can select the ‘Just Show’
option.
19
6 Using the OUWorkspace
An OUWorkspace can always be opened from within BlueJ by selecting
Tools | OUWorkspace.
Only one OUWorkspace may be open at a time. If you try to open an OUWorkspace when
one is already open a dialogue box with the message ‘Only one OUWorkspace open at a
time!’ will be displayed.
When an OUWorkspace is opened it is configured to work with the currently open BlueJ
project allowing you to create and manipulate instances of the classes defined in that project.
In addition you have access to many of the standard Java classes and the classes in the OU
Class Library as described under Help | OU Class Library. If no BlueJ project is open then you
only have access to the standard Java classes and the classes in the OU Class Library.
As the OUWorkspace is configured to work with the currently open project, whenever you
close a BlueJ project (either explicitly when you use Project | Close or implicitly when you
open a different project) any open OUWorkspace will automatically be closed.
Opening an OUWorkspace brings up the window shown in Figure 27.
20
Figure 28 An OUWorkspace in use
The Code Pane is where you type and execute Java statements. Before statements can be
executed in the Code Pane they must be highlighted (see below). The Display Pane is where
any textual output relating to those executed statements, including error messages, is
displayed. The area labelled Variables holds a list of the currently declared variables in this
case hoppyHeight and hoppy. You can inspect the variables in the Variables list by double
clicking on them (see Subsection 6.2).
21
6.2 The Inspector window
Figure 28 shows the Variables list containing two variables: hoppyHeight and hoppy. You
can inspect these variables either by double-clicking on the variable in the Variables list or by
highlighting it in the Variables list and using the Enter key. Inspecting a variable opens a new
window. For example inspecting the hoppyHeight variable displays the window shown in
Figure 29.
The inspector shows that the variable hoppyHeight holds a value of type int with a value
of 5.
If you inspect the variable hoppy you will see the inspector shown in Figure 30.
Figure 30 The inspector opened on the HoverFrog object referenced by the variable
hoppy
The inspector window shows that hoppy references a HoverFrog object. The inspector
window for an object always has three columns that list: the object’s attributes, the types of
those attributes and the values of those attributes.
When an attribute of type OUColour is shown in an inspector the value displayed is the
actual colour, in this case, yellow. If you try double-clicking on the height and position rows in
the inspector nothing happens, but if you double-click on the colour row another inspector
opens as shown in Figure 31.
22
Figure 32 Inspecting an uninitialised variable of type Frog
If we have executed the statement int i; in the Code Pane and we inspect i the inspector
of Figure 33 will be shown. The variable i is shown to have the value of 0 which is the
default value for an int variable.
23
If you hit the F12 key you will see the dialogue box shown in Figure 34.
Once the OUWorkspace has reset you will see the following dialogue box.
Figure 35 Dialogue box shown when the OUWorkspace has been reset
If you try to execute statements in the Code Pane while the previous execute statement is still
running you will see the dialogue box shown in Figure 36. You then have to make a decision
as to whether you think the statements just need more time to complete (in which case you
should select No) or if they are never going to complete (in which case you should select Yes
to reset the OUWorkspace).
Figure 36 Dialogue box shown when the OUWorkspace is busy and attempts are made
execute additional statements
Please note that if the OUWorkspace executes an infinite loop it will start to slow your
computer down, by grabbing all the CPU (and depending on the code executing, memory as
well) – if this is the case you should reset the OUWorkspace. All the code you are expected to
execute in the OUWorkspace should execute within a few seconds, so if no response has
been received in that time using the F12 key is probably advisable (unless you have a
particularly slow computer in which case you might need to wait a little longer).
24
• Save As – saves the statements in the Code Pane to a specified file. Selecting
this option opens a file dialogue box focused on the project’s folder. You should
type a valid file name in the File name: edit box. You can omit an extension as if
none is given a .txt extension is automatically added.
• Exit – closes the OUWorkspace. You will be prompted as to whether you wish to
save any statements from the Code Pane to file (unless they have already been
saved).
Edit
• Select All* – selects all the text in the pane.
• Cut – deletes the selected text from the Code Pane and copies it to the system
clipboard.
• Copy* – copies the selected text from the pane to the system clipboard.
• Paste – pastes the contents of the system clipboard into the Code Pane.
• Undo – undoes the previous editing action. Successive uses of undo allows the
user to work back through the most recent edits.
• Redo – redoes the previous editing action. Successive uses of redo allows the
user to work forward again through the most recent undo commands.
Items in this menu are only available when either the Code Pane or Display Pane are
selected. If the Code Pane is selected all items are available, but for the Display Pane only
those items marked with a * are available.
Action
• Execute Selected – executes any text which is selected in the Code Pane.
• Clear Display Pane – clears the contents of the Display Pane.
• Clear Code Pane – clears the contents of the Code Pane. If the text in the
Code Pane has been modified and not saved the user will be prompted as to
whether to save the text. If some of the text in the Code Pane is highlighted then
the user is prompted to save all or just the selected text.
• Reset OUWorkspace – clears all the variables in the Variables Pane and closes
any open Graphical Display. The user will be prompted either to retain the Code
Pane in its current state or to clear the text. The option is equivalent to closing the
OUWorkspace and reopening it and if necessary using the Restore Code Pane
option to reload the statements in the Code Pane.
• Restore Code Pane – in the event of either BlueJ or the OUWorkspace crashing,
this option can be used to recover the last statements executed in the
Code Pane.
Graphical Display
This menu is only present if the current open project includes classes which can be displayed
graphically (Amphibians and Shapes).
• Open – opens an instance of the graphical display.
• Close – closes the instance of the graphical display.
25
Code Pane and Display Pane popup menus
• Execute Selected – evaluates the selected text (equivalent to Action | Evaluated
Selected).
• Copy* – copies the selected text from the pane to the system clipboard.
• Paste – pastes the contents of the system clipboard into the selected pane.
• Undo – undoes the previous editing action. Successive uses of undo allows the
user to work back through the most recent edits.
• Redo – redoes the previous editing action. Successive uses of redo allows the
user to work forward again through the most recent undo commands.
* These are the only two options on the Display Pane popup menu.
26
7 Editing classes in BlueJ
Using the BlueJ editor to edit Java classes is straightforward. To open the editor on a class
either double-click on the class’s icon or select the class and use the Enter key to bring up the
popup menu and select Open Editor. Figure 37 shows the editor opened on the Frog class.
27
If you open the editor on the class and it opens with the interface view, or you accidentally
switch to the interface view when using the editor you should switch back to the implementation
view either using the View dropdown box or the Tools | Toggle Interface View menu option.
If you have switched the editor to the interface view and, after clicking on a link, it stops
responding then you need to close the editor window close BlueJ and then relaunch BlueJ.
When you open the editor on the class it will be in the interface view and you should switch it
back to the implementation view using the View dropdown box.
Figure 38 Part of the editor opened on the HoverFrog class and showing a syntax error in
the getHeight() method
The error message in the information area is very minimal and it may not be sufficient for you
to correct the error. You may be able to get more information on the error by clicking the
? button to the right of the error message. For the error shown in Figure 38. you would get the
additional information shown in Figure 39.
28
An easy error to make is to miss the semicolon off the end of a statement. If you do this then
typically the line of code highlighted is the one after the statement with the missing ‘;’ as
shown in Figure 40.
Figure 40 Part of the editor opened on the HoverFrog class and showing a syntax error
resulting from a missing semicolon
Clicking the ? button to the right of the error message will display the following dialogue box.
Figure 41 The full error message shown when a missing semicolon is detected
If the OUWorkspace is open when you compile a class then the OUWorkspace will be reset
and all variables will be removed from the Variables list and the Display Pane will be cleared,
but any code statements in the Code Pane will be retained.
29
This message appears under two circumstances:
1. BlueJ crashed the last time you closed the project.
2. BlueJ did not crash the last time you closed the project, but you did close it
without compiling the class.
In both cases you need to click the OK button to open the editor and then check the class
carefully. If you find that the class has become corrupted then you should follow the
instructions given in the message.
If you find that the message still occurs (it is only shown the first time the editor is opened on
a class during a BlueJ session) once you can compile and use the class, then you can delete
the backup versions of the class. To do this you should use Windows Explorer to navigate to
the project folder and delete the files with the name of the class and the extensions .java#
and .java#backup. So, for example, if you are having problems with the Frog class you
would need to delete the files Frog.java# and Frog.java#backup – you should leave all
other files exactly as they are.
30
8 Keyboard shortcuts
8.1 BlueJ
31
View Menu ALT+V
Show Uses CTRL+U
Show Inheritance CTRL+I
Show Debugger CTRL+D
Show Terminal CTRL+T
Show Code Pad CTRL+E
32
Class Menu ALT+C
Save CTRL+S
Reload
Page Setup
Print… CTRL+P
Close CTRL+W
33
8.3 OUWorkspace
Shortcut keys used throughout the OUWorkspace.
Button Shortcut
OK ALT+O
Cancel ALT+C
Yes ALT+Y
No ALT+N
Note:
• Buttons and menu options can be activated with either ENTER or SPACE. The
CANCEL button on file dialogues (File | Open, File | Save As) does not respond
to ENTER, but the dialogue can be closed using ESCAPE.
• The state of check boxes is changed using SPACE (or the shortcut key given
below).
Action Shortcut
Go to Code Pane ALT+C
Go to Display Pane ALT+D
Go to Variables List ALT+V
Show Results (toggle ALT+S
on/off)
File Open Dialogue CTRL+O
Save Code Pane to CTRL+S
current file
Evaluate Selected CTRL+E
Clear Display Pane CTRL+D
Clear Code Pane CTRL+K
Reset OUWorkspace CTRL+R
Restore to Previous CTRL+T
Session
Stop infinite loop and F12
reset Workspace
34
Edit Menu ALT+E
Select All* ALT+E, A CTRL+A
Cut ALT+E, T CTRL+X
Copy* ALT+E, C CTRL+C
Paste ALT+E, P CTRL+V
Undo ALT+E, U CTRL+Z
Redo ALT+E, R CTRL+Y
System.out.println(…); ALT+E, S CTRL+P
Note:
Items in this menu are only available when either the Code Pane or Display Pane are
selected. If the Code Pane is selected all items are available, but for the Display Pane only
those items marked with a * are available.
35
Appendix – M255 Software Issues and Solutions
A3.1 Amphibian Worlds and Accounts World desktop shortcuts do not work 42
OUWorkspace 42
A3.5 BlueJ Help menu does not include OU Class Library option 43
36
This appendix is concerned with configuration problems that some students have
encountered – either in BlueJ or the M255 software – rather than the recognised behaviour of
the software (which is covered in the main part of this document).
For some of the fixes described in this section you will need to know the following.
• The installation folder of BlueJ.
Finding this folder is described in Subsection A1.1. The default installation folder
for BlueJ is C:\BlueJ. If you installed BlueJ elsewhere, for example C:\Program
Files\BlueJ, then wherever you see references to C:\BlueJ you will need to
substitute in your particular folder (e.g. C:\Program Files\BlueJ).
• The installation folder of the Java SDK 1.6.0_07.
Finding this folder is described in Subsection A1.2. The default installation folder
for the Java SDK 1.6.0_07 is C:\Program Files\Java\jdk1.6.0_07. If you installed
the Java SDK 1.6.0_07 elsewhere, for example, C:\Java\jdk1.6.0_07, then
wherever you see references to C:\Program Files\Java\jdk1.6.0_07 you will
need to substitute in your particular folder (e.g. C:\Java\jdk1.6.0_07).
Throughout this document, all references to the BlueJ and Java SDK 1.6.0_07 folders are
shown in bold, as a reminder that if you did not install the software in the default location you
will need to change the instructions accordingly.
If BlueJ is not using Java 1.5, or above, the M255 software will not work correctly. Windows
Vista users must use Java 1.6 or above. Currently the course software CD-ROM supplies
Java 1.6.0_07. Subsection A1.2 tells you how to determine which version of Java BlueJ is
using.
37
A1 Obtaining installation information
A1.1 Where is BlueJ installed?
The default installation folder for BlueJ is C:\BlueJ.
The easiest way to determine the installation folder is to right click on the BlueJ icon on the
desktop and select Properties. If the target is C:\BlueJ\bluej.exe then you installed BlueJ in
the default location of C:\BlueJ. If the target is, for example, C:\Program Files\BlueJ\bluej.exe
then you installed BlueJ in C:\Program Files\BlueJ.
If you did not install BlueJ in C:\BlueJ, but in, for example, C:\Program Files\BlueJ, then
wherever you see references (in bold) in this document to C:\BlueJ you need to substitute in
your particular installation folder (e.g. C:\Program Files\BlueJ).
C:\Program Files\Java\jdk1.6.0_07.
The easiest way to determine the installation folder is to launch BlueJ and select
Help | About BlueJ. A window similar to that shown below in Figure A1 will be displayed.
38
A2 Known BlueJ issues
A2.1 Launching BlueJ only (briefly) displays the splash screen
There is a rare problem on some machines that means that when BlueJ is launched the
splash screen appears, but when it vanishes the main BlueJ window does not appear.
To try to solve the problem you should launch the M255 Utility program using:
Start | Programs | M255 | M255 Utility
The window shown below will be displayed.
39
A2.2 BlueJ suddenly crashes and vanishes from desktop
This is a hardware problem associated with BlueJ and there are a number of potential solutions.
The first approach to try is to turn off DirectDraw acceleration by carrying out the following steps.
1 Select Start | Run and type dxdiag in the Open edit box and click OK.
2 The DirectX Diagnostic Tool should open – select the Display tab.
3 Disable DirectDraw Acceleration.
4 Click Exit.
If this does not work, the drivers for the video card may need updating, or a later version of
DirectX may be required (the version of DirectX is given on the System tab of the DirectX
Diagnostic Tool and you may find a later version on the Online Applications CD-ROM).
40
This message appears under two circumstances.
1. BlueJ did crash the last time you closed the project. If this is the case click the OK button
to open the editor, check the class carefully and, if necessary, follow the instructions
given in the message.
2. BlueJ did not crash the last time you closed the project, but you did close the project
without compiling the class. Again you should click the OK button to open the editor since
it is prudent to quickly check that the class is correct. We suggest you then try to compile
the class and if necessary correct any compilation errors.
The message is only shown the first time the editor is opened on a class during a BlueJ
session with that project. In most cases, once you have successfully compiled the project the
message will not reappear when the project is subsequently opened. If the message persists
once the class has been compiled you should use Windows Explorer to navigate to the
project folder and delete the files with the name of the class and the extensions .java# and
.java#backup. Thus, if you are having problems with the Frog class you would need to
delete the file Frog.java# and Frog.java#backup – you should leave all other files
exactly as they are.
41
A3 Known issues with OU additions to BlueJ
A3.1 Amphibian Worlds and Accounts World desktop shortcuts do not
work
If the Amphibian Worlds and Accounts World desktop shortcuts do not work, you can launch
the applications from within BlueJ, as described in the first part of this document (Subsection
5.3). This problem will occur if the M255 Project folder has been moved since the initial
installation, or if the version of Java selected during the installation has been removed.
42
A3.5 BlueJ Help menu does not include OU Class Library option
There are two ways to resolve this problem: either by creating a desktop shortcut directly to
the OU Class Library documentation (this is the easiest way), or by editing the
bluej.properties file to install the necessary menu item in the BlueJ Help menu.
C:\BlueJ\lib\userlib\oudoc
2
Right-click on the file index.html (it may just be shown as index) and from the
menu presented select Create Shortcut. A shortcut called Shortcut to index.html
(or just Shortcut to index) will appear in the folder.
3 Drag the shortcut onto the desktop.
4 Right-click on the shortcut and from the menu select Rename, and change the
name to OU Class Library.
5 Double-clicking the icon will launch the browser focused on the OU Class Library
documentation.
Editing the bluej.properties file
The bluej.properties file is used to set various user preferences in BlueJ. The location
of the this file depends on which version of Windows you are running.
• On Windows XP and Windows 2000 it is found in:
C:\Documents and Settings\<username>\bluej
(where <username> is the name you use to log on to your computer).
• On Windows 98SE and Windows ME it is found in:
C:\Windows\bluej
Note: the bluej.properties file is found in the same location as BlueJ’s debug log file
(bluej-debuglog.txt) and the location of this file is given as the last line on the
Make sure BlueJ is not running and then edit the bluej.properties file (using WordPad)
as described below.
1 At the end of the file append these two lines which will add a menu item to
OR
bluej.help.ouInfo.url=file\:///C\:/Program%20Files/BlueJ/lib/userlib/oudoc/index.html
Note that any spaces in the pathname are replaced by %20, use \ and / as appropriate, and
watch out for the ///.
Once you have added the necessary lines to the bluej.properties file, save it and exit
WordPad. When you next launch BlueJ you should be able to select the OU Class Library
43
A3.6 OUWorkspace or Accounts World stop responding
Both the OUWorkspace and Accounts World can display dialogue boxes as detailed in the
following examples.
• The Accounts World displays a dialogue when the Add Account button is used.
• The methods of the OUDialog class are used in the OUWorkspace.
• In most cases both the OUWorkspace and Accounts World display a dialogue prompting
the user to save the contents of the Code Pane before they can be closed.
These dialogue boxes are modal. When a modal dialogue box is open it blocks input to all
other windows of that program, so if you have the Add Account... dialogue open in the
Accounts World the main Accounts World window will not respond to any inputs from the user
until the Add Account... dialogue is closed. Similarly, if you have an OUdialog.alert()
dialogue open in the OUWorkspace the main OUWorkspace window will not respond to any
inputs until the alert box is closed.
A problem occurs if the main window overlies the open dialogue box. Consider the following
scenario.
• The Accounts World is open and the Add Account button has been used to open the
Add Account... dialogue.
• An unrelated window has been placed on top of the Accounts World such that the
Add Account... dialogue (or Accounts World) is no longer visible.
• The Accounts World has been brought to the front of the desktop by clicking the Accounts
World button on the TaskBar.
Now the main Accounts World window is visible, but it will not respond because the
Add Account... dialogue is open and waiting for input. Unfortunately the dialogue box is
hidden behind the main Accounts World window.
To bring the Add Account... dialogue in front of the main Accounts World window use the
keyboard as follows.
• Hold down the ALT key and then use the TAB key. A window appears in the middle of the
desktop showing the icons of all the currently open programs. One of these icons will
have a blue box around it, and a brief description of this program will appear at the bottom
of the window. If both keys are released at this point the program corresponding to the
icon with the blue box will be brought to the front and become the active window.
• If the ALT key is held down, successive presses of the TAB key will move the blue box
from one icon to the next and the descriptions change to correspond to the current icon.
• To bring the Add Account... dialogue to the front use the ALT and TAB keys to cycle
through the icons until you find the Java icon (a cup and saucer) with the description
Add Account... Releasing the ALT and TAB keys at this point will bring the Add Account...
dialogue in front of all other windows to become the active window.
• Once the Add Account... dialogue is visible the dialogue can be closed and this returns
control to the main Accounts World window.
Using ALT and TAB allows you to switch successfully to either an OUWorkspace or an
Accounts World regardless of whether or not they have a dialogue box open. Clicking the
appropriate button on the TaskBar will bring an OUWorkspace or Accounts World to the front
of the desktop, but it will only be active provided it does not have a dialogue box open.
44