1
主窗口的場景中有一個按鈕。當它被點擊,創建新的窗口,按照下面的代碼:如何在JavaFX中阻止主窗口
public static void create()
{
Stage stage = new Stage();
AnchorPane pane = new AnchorPane();
//Here i add some into pane
stage.setScene(new Scene(pane));
stage.setWidth(500);
stage.setHeight(600);
stage.show();
}
我想在主窗口,解除封鎖(即用戶將無法點擊按鈕,輸入文字,調整或與其他方式進行交互),直到附加窗口關閉。
https://docs.oracle.com/javase/9/docs/api/javafx/stage/Stage.html#initModality-javafx.stage.Modality- –