如何使用setFullScreenExitHint?
因为:无法解析方法“ setFullScreenExitHint”
你有什么更好的方法像setFullScreen吗?
JDK:jdk1.8.0_171
package game;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Rectangle2D;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
Parent parent = FXMLLoader.load(getClass().getResource("/view/login.fxml"));
Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds();
Scene scene = new Scene(parent, screenBounds.getWidth(),
screenBounds.getHeight());
primaryStage.setFullScreen(true);
primaryStage.setScene(scene);
primaryStage.show();
}
}
相关分类