1
我有一個全屏應用程序,但是當我以非全屏模式打開新對話框(控制器)時,顯示Windows啓動面板。如何用javafx創建完整的全屏應用程序?如何使用javafx創建完整的全屏應用程序
upd 現在我打開我的對話框......沒有其他的(skype,日食在屏幕上)窗口,它完美的作品。也許它在javafx中的錯誤?
public class Main extends Application {
@Override
public void start(final Stage primaryStage) {
Button btn = new Button();
btn.setText("Say 'Hello World'");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
Stage dialogStage = new Stage(StageStyle.UTILITY);
dialogStage.initModality(Modality.APPLICATION_MODAL);
dialogStage.setScene(new Scene(VBoxBuilder.create()
.children(new Text("Hi"), new Button("Ok."))
.alignment(Pos.CENTER).padding(new Insets(100)).build()));
dialogStage.initOwner(primaryStage);
dialogStage.show();
System.out.println(dialogStage.getOwner() == primaryStage
.getOwner());
}
});
StackPane root = new StackPane();
root.getChildren().add(btn);
Rectangle2D r = Screen.getPrimary().getBounds();
Scene scene = new Scene(root, r.getWidth(), r.getHeight());
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.setFullScreen(true);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
我UPD我的問題 – zella