1. 窗口最大化显示
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds(); stage.setX(primaryScreenBounds.getMinX()); stage.setY(primaryScreenBounds.getMinY()); stage.setWidth(primaryScreenBounds.getWidth()); stage.setHeight(primaryScreenBounds.getHeight());