javafx模态窗口

文章转载至   http://www.oschina.net/question/95289_87661


public class StageTest extends Application {
	@Override
	public void start(Stage primaryStage) throws Exception {
		primaryStage.setWidth(600);
		primaryStage.setHeight(400);
		primaryStage.setScene(new Scene(new StackPane()));
		primaryStage.show();
		{// 非模态
			Stage stage = new Stage();
			stage.setWidth(300);
			stage.setHeight(200);
			stage.show();
		}
		{// 模态
			Stage stage = new Stage();
			stage.initModality(Modality.APPLICATION_MODAL);
			stage.setWidth(300);
			stage.setHeight(200);
			stage.show();
		}
	}

	public static void main(String[] args) {
		Application.launch(args);
	}
}

猜你喜欢

转载自blog.csdn.net/u011943534/article/details/60142529