BlueJ 3.0 – What’s new

We’ve been working on it for the last eight months, and now it’s finally here: BlueJ 3.0.

Version 3.0 of BlueJ includes the most significant set of updates to BlueJ functionality since version 2.0 was released in 2004. (Yes – 2004! That was when we had no Google maps, no Facebook, no Twitter. It’s really that long ago…)

It might be good to summarise the most important of them.

The one thing that many people will notice first is an interface update:

The BlueJ 3.0 main window

The interface had a slight update and polish. Nothing too significant – we aimed at providing a slightly more modern appearance while still retaining the instantly recognisable “BlueJ look”. As part of the interface update, object inspectors have also changed in looks:

An object inspector

The inspector now looks like a magnified version of an object on the object bench. This emphasises that this is just another view of the same thing (just with additional detail provided).

The functionality of the object inspector is unchanged: fields can still be inspected further, static fields can be displayed, and so on.

The main changes in BlueJ 3.0, however, are not its looks. Our main effort has gone into improving the editor.

The BlueJ editor has always been fairly simple. 10 years ago, when it was originally written, it was simple and mainstream. Today, it was just embarrassingly simple.

Davin McCall, one of our senior developers on the BlueJ team, has implemented a new parser for BlueJ that forms the basis for much of the new editor functionality that you can see in 3.0, and also for some future features that will appear over the next few months. The most interesting of the new editor features are:

Scope highlighting,

the navigation view, and

code completion.

Let’s briefly look at them.

Scope highlighting

We have added background colouring to the editor to highlight scopes:

The new BlueJ 3.0 editor

The highlight makes it easier to see when brackets are missing or mismatched, and thus makes some errors more obvious. It hopefully helps students understand the concept of nested scopes.

The Navigation View

The Navigation View

To the right of the editor is the “Navigation View”.

The navigation view shows a miniature version of the full class text, and highlights the currently selected viewport.

It is usable like a scroll bar: The view can be dragged, clicked, moved with a mouse wheel, etc. This gives a better overview over a source file for easier navigation.

When the mouse hovers over the navigation view, tool tips show relevant method names – this makes jumping to specific methods quicker than before.

The idea for the navigation view is taken from the “Fluid Source Code Editor” by Michael Desmond, which I saw presented at the PPIG workshop by Chris Exton.

Code completion

One of the most contentious non-features of BlueJ was, and always has been, code completion.

Almost from the very beginning, when BlueJ 1.0 was released in 1999, people have asked for code completion. Other people have been tearing their hair out in horror at the mere mention of the possibility of code completion ever being added to BlueJ. The discussions at the First Vatican Council were just a chat over coffee in comparison.

In the past, we have sided with the contra faction. (Okay, I admit: we have pretty much led the contra faction.)

Fact is: we have always aimed at providing tools that can be taken for granted in all reasonably modern development environments. 10 years ago, this included compilers and debuggers, but not code completion.

Code completion, back then, was still a “cool feature” that only a few high end environments provided. We did not want to create reliance on a feature that might be absent later in other environments, which meant that students could not look up documentation competently.

This has now clearly changed. Code completion is now a standard feature in mainstream environments, and the arguments against using it have grown weaker than my grandmother’s bed time cup of tea.

So, in short: code completion is finally here.

In the BlueJ editor: code completion

In contrast to other environments, the code completion pane does not pop up automatically, but has to be activated explicitly (Ctrl-Space, by default). This means that the code completion function will not pop up unexpectedly and frighten beginners into spilling their Dr Pepper over their keyboards.

And wait, there’s more…

There is more good stuff to find in the latest BlueJ release. If you are interested, have a look at the BlueJ change log or — better still — download it and give it a run around the block.

You might like it.

(Images in this post are produced by the author and are hereby placed in the public domain.)

No, the shading cannot be turned off. Give it a day or two, and see how you feel. We were doubtful at first as well, but we found that after a day or two it grows on you. At least for us. In fact, after using it for a day, I suddenly found the old look strangely empty.

I am hoping that there will not be a need for a switch, so that we can keep the look consistent for all installations.

My first-year students were all excited in the lab and told me that BlueJ 3.0 was now in final. The braver ones had already installed it and we really like the scope coloring, the slider and the hackers love the auto-completion. The error messages are better, but they need to be copy-able.

We get a bizarre one when we add
int a = myCanvas.getWidth();
to the balls project in chapter 5 –
“cannot find symbol – method getWidth(); maybe you meant: getWidth()”

Are you overriding this somewhere? We worked around using getSize and picking the width off the Dimension. But it is kind of strange.

In this version, we introduced a new parser, which gives us the basis for a number of possible improvements. The first are already there (scope colouring and code completion), and next will be improved error messages.

We have introduced one small experiment with error messages, and that’s the one you are seeing. When you use an unknown identifier, it tries to suggest the right one.

In your case, this obviously went wrong – we will investigate this. In future, we will hopefully get this right.

You can make it glossy, but under the hood it’s still bluej.
And who the heck had the Idea with the preview scroll bar, thats the most useless thing I’ve ever seen, unless you have xray vision like superman you won’t even be able to guess what the lines of different length have to do with your code…
Do us all a favor and quit the project so students in the first years of computer science can’t be tortured with it anymore…

Hi all,
I found this BlueJ very intresting and very excited to have a look.The UI is good and lot of chances to know how exactly our code running but i cannot find auto code generation that is available with other Editors.

While working on “Eclipse4Edu” projet we wanted to make the same Scope highlighting for the Scheme programming language but we ended up lacking time. You did a really nice job doing it for java i will be happy to know how it work (how you made it) and i will surely have a look at the code :)
Just don’t let anyone convince you it isn’t the way to go. For new student learning programming it really help them because it me the code much more clear as it have been shown by “MIT Scratch programming language”. Something that could be nice is if the editor could detect common code snippet and higlight them with unique color.