注:打开的模式对话框内是一个嵌套的html页面。(个人需求,和模式对话框没什么关系)
一、模式对话框代码:
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.concurrent.Worker.State;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.ScrollPane;
import javafx.scene.paint.Color;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Modality;
import javafx.stage.Stage;
public class ModalDialog extends Application {
/**
* 网页地址
*/
private String url;
public ModalDialog(final Stage stg, String url) {
this.url = url;
final Stage stage = new Stage();
// Initialize the Stage with type of modal