You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When shown, the scene seems to be positioned slightly above the center of the screen. The goal is to move the scene to the center of the screen at startup.
The text was updated successfully, but these errors were encountered:
Centering a scene is made by doing this in the code: Link to solution
public static final Rectangle2D SCREEN_BOUNDS = Screen.getPrimary().getVisualBounds();
public static final int STAGE_WIDTH = (int) SCREEN_BOUNDS.getWidth() / 2;
public static final int STAGE_HEIGHT = (int) SCREEN_BOUNDS.getHeight() / 2;
.
.
.
primaryStage.setX(STAGE_WIDTH / 2);
primaryStage.setY(STAGE_HEIGHT / 2);
Group root = new Group();
Scene scene = new Scene(root, STAGE_WIDTH, STAGE_HEIGHT, Color.BLACK);
primaryStage.show();
When shown, the scene seems to be positioned slightly above the center of the screen. The goal is to move the scene to the center of the screen at startup.
The text was updated successfully, but these errors were encountered: