Scratch for Java

Scratch for Java (Version 5.0.2)

Scratch for Java lets you keep everything you learned in Scratch — sprites, costumes, the stage, move, say, when key pressed — and write it as Java instead of dragging it.

It is built for the moment a class outgrows Scratch but is not ready to start Java from an empty file.

import org.openpatch.scratch.*;
 
public class MyStage extends Stage {
  public MyStage() {
    Sprite bunny = new Sprite();
    bunny.addCostume("bunny1_stand");
    this.add(bunny);
  }
}

That is a complete program, and it needs no image files: 838 pictures and 266 sounds are built in.

Seeing it side by side

The following video shows a Scratch project and a similar BlueJ project using the Scratch for Java library.

If you want to compare it yourself, you can take a look inside both projects:

Special Thanks

The Scratch for Java library is profiled using Java Profiler

Java Profiler

Welcome

Create Shareable URL

Select Sections