Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Window Size and Full Screen

Ben Fry edited this page · 20 revisions

This page covers window sizing with sketches as well as full screen mode. In Processing 3.0, there are improvements and changes to how full screen is handled, as well as improved multiple monitor support.

Making Sketches Resizable

This section only pertains to the desktop version of Processing (not JavaScript or Android), because it's the only one to use windows and frames.

It's possible to make the sketch window resizable. To do this, use the following:

void setup() {
  size(400, 400);  // size always goes first!

This is not enabled by default because most sketches won't behave well when resized. If a sketch is running inside a web browser, the surface variable will be null.

You can also change the size of the window using the Java method surface.setSize(w, h). Note that you must first set the frame to be resizable.

Running at Full Screen

With Processing 3.0, use the fullScreen() method to run at full screen. Alternately, use Sketch → Present as an alternative to Sketch → Run to enter full screen mode.

Display at full screen

The fullScreen() function should always be the first line in setup() or it should appear inside of the settings() function, new for Processing 3.0. If the computer has one screen, the software will open on that screen. If the computer has more than one screen, the software will appear on the screen specified in the “Run sketches on display” option in Preferences (see below). These two examples show how it works:

void setup() {
  ellipse(width/2, height/2, height, height);

Use this version when running from another IDE like Eclipse or IntelliJ:

void settings() {

void setup() {
  ellipse(width/2, height/2, height, height);

See the fullScreen() and settings() reference for more information.

In Ubuntu Linux under the default “Unity” desktop environment, it's often not possible to cover the screen completely with your Processing sketch. You can use a second desktop environment which does full screen just fine.

Disabling Full Screen Mode

You can use the Java method surface.setSize(w, h) to change the size of the window, even one that has started at full screen. However, changing the size of a full screen window will leave you with a window that has no title bar and will not be draggable.

Using Multiple Monitors

A lot of effort has gone into fixing up support for multiple displays in 2.0 and 3.0.

By default, a full screen application doesn't cover multiple displays. This is often the preferred solution (for instance, when coding on one monitor and displaying on another). In some cases (usually involving OpenGL), using a single sketch across multiple displays may cause it to run more slowly. This depends on the graphics card, drivers, etc. and is out of our control.

Full screen on any display

The fullScreen() function has parameters to define on which screen to run the software and to span the software across multiple displays as a continuous surface. For example, to display full screen on the second display, use this code:

void setup() {
  ellipse(width/2, height/2, height, height);

Running a sketch across multiple displays

If you want to use multiple monitors as a continuous window, use fullScreen() and use SPAN as the parameter instead of the number of an individual screen.

void setup() {
  ellipse(width/2, height/2, height, height);

See the fullScreen() reference for more information.

“Run sketches on display” option in Preferences

The "Run sketches on display" option in the Preferences window sets the display where sketches are initially placed. As usual, if the sketch window is moved, it will re-open at the same location, however when running in full screen mode through Sketch → Present, the display selected here will always be used.

When exporting an application, that display preference will be saved into the exported application.

Something went wrong with that request. Please try again.