Scratch for Java

Window::useFullScreen()

Browser availability: desktop-only.

The embedded browser output uses its enclosing page; this desktop window option only reports a limitation.

Makes the window fill the whole screen.

Call it before the first stage is created, because the size of the window is settled the moment it opens:

public static void main(String[] args) {
  Window.useFullScreen();
  new MyStage();
}

Examples

This example requires the desktop runtime in the current browser revision.

void main() {
  // Has to be said before the window is built, because it decides how the
  // window is made. Only the desktop version can go fullscreen.
  Window.useFullScreen();
  Window myWindow = new Window();
  myWindow.setStage(new Stage());
}
 

View on GitHub

Syntax

Java

.useFullScreen()

Return

void

useFullScreen()

Create Shareable URL

Select Sections