我有一个嵌入了JavaFX WebView的Swing应用程序。我可以使用WebView的WebEngine加载初始网页。但是,后续调用WebEngine.load由于某种原因无法正常工作。这是我添加到WebEngine的调试代码:
private static WebView initFX(JFXPanel fxPanel) {
StackPane root = new StackPane();
Scene scene = new Scene(root, Color.ALICEBLUE);
final WebView webView = new WebView();
final WebEngine webEngine = webView.getEngine();
root.getChildren().add(webView);
webEngine.load("http://www.google.com");
webEngine.setOnAlert(new EventHandler<WebEvent<String>>() {
@Override
public void handle(WebEvent<String> arg0) {
System.out.println("alert: " + arg0);
}
});
webEngine.getLoadWorker().progressProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> arg0, Number arg1, Number arg2) {
System.out.println("Process changed: " + arg0 + ", arg1: " + arg1 + ", arg2: " + arg2);
}
});
webEngine.getLoadWorker().messageProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> arg0, String arg1, String arg2) {
System.out.println("message changed: " + arg0 + ", arg1: " + arg1 + ", arg2: " + arg2);
}
});
webEngine.getLoadWorker().exceptionProperty().addListener(new ChangeListener<Throwable>() {
@Override
public void changed(ObservableValue<? extends Throwable> arg0, Throwable arg1, Throwable arg2) {
throw Throwables.throwUncheckedException(arg2);
}
});
webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<Worker.State>() {
@Override
public void changed(ObservableValue<? extends Worker.State> arg0, Worker.State arg1, Worker.State arg2) {
System.out.println("old state: " + arg1 + ", new state: " + arg2 + ", arg0: " + arg0);
}
});
fxPanel.setScene(scene);
return webView;
}
然后我们有了试图更改网页的代码:
// Drag and drop event comes in on the AWT thread.
// Switch to the FX thread and run the load there
public void dropObjects(Iterable<Locator> objects) {
try {
browserControllerLatch.await();
Platform.runLater(new Runnable() {
@Override
public void run() {
webView.getEngine().load("http://www.arstechnica.com");
}
});
} catch (InterruptedException e) {
throw Throwables.throwUncheckedException(e);
}
}
这会产生以下输出。我首先加载谷歌,然后尝试加载nytimes.com。
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@7f311653, name: progress, value: 0.30000000000000004], arg1: 0.0, arg2: 0.30000000000000004
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@7f311653, name: progress, value: 0.3750537109375], arg1: 0.30000000000000004, arg2: 0.3750537109375
message changed: ReadOnlyStringProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: message, value: Loading http://ssl.gstatic.com/gb/images/b_8d5afc09.png], arg1: , arg2: Loading http://ssl.gstatic.com/gb/images/b_8d5afc09.png
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.0], arg1: -1.0, arg2: 0.0
old state: READY, new state: SCHEDULED, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: state, value: SCHEDULED]
old state: SCHEDULED, new state: RUNNING, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: state, value: RUNNING]
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.1361267397098016], arg1: 0.0, arg2: 0.1361267397098016
message changed: ReadOnlyStringProperty [bean: javafx.scene.web.WebEngine$LoadWorker@7f311653, name: message, value: Loading complete], arg1: Loading http://www.google.com/, arg2: Loading complete
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@7f311653, name: progress, value: 1.0], arg1: 0.3750537109375, arg2: 1.0
old state: RUNNING, new state: SUCCEEDED, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@7f311653, name: state, value: SUCCEEDED]
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.2439676525013781], arg1: 0.1361267397098016, arg2: 0.2439676525013781
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.3674793663516144], arg1: 0.2439676525013781, arg2: 0.3674793663516144
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.49099108020185067], arg1: 0.3674793663516144, arg2: 0.49099108020185067
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.5579187727289953], arg1: 0.49099108020185067, arg2: 0.5579187727289953
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.6248464652561398], arg1: 0.5579187727289953, arg2: 0.6248464652561398
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.6917741577832844], arg1: 0.6248464652561398, arg2: 0.6917741577832844
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.7067348499897916], arg1: 0.6917741577832844, arg2: 0.7067348499897916
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.8196757488843449], arg1: 0.7067348499897916, arg2: 0.8196757488843449
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 0.8548236404421787], arg1: 0.8196757488843449, arg2: 0.8548236404421787
message changed: ReadOnlyStringProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: message, value: Loading complete], arg1: Loading http://ssl.gstatic.com/gb/images/b_8d5afc09.png, arg2: Loading complete
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: progress, value: 1.0], arg1: 0.8548236404421787, arg2: 1.0
old state: RUNNING, new state: SUCCEEDED, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@2514c48a, name: state, value: SUCCEEDED]
message changed: ReadOnlyStringProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: message, value: Loading stopped], arg1: Loading http://www.google.com/, arg2: Loading stopped
old state: RUNNING, new state: CANCELLED, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: state, value: CANCELLED]
message changed: ReadOnlyStringProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: message, value: ], arg1: Loading stopped, arg2:
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: -1.0], arg1: 0.0, arg2: -1.0
old state: CANCELLED, new state: READY, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: state, value: READY]
message changed: ReadOnlyStringProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: message, value: Loading http://www.nytimes.com/], arg1: , arg2: Loading http://www.nytimes.com/
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.0], arg1: -1.0, arg2: 0.0
old state: READY, new state: SCHEDULED, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: state, value: SCHEDULED]
old state: SCHEDULED, new state: RUNNING, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: state, value: RUNNING]
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.30000000000000004], arg1: 0.0, arg2: 0.30000000000000004
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.37692307692307697], arg1: 0.30000000000000004, arg2: 0.37692307692307697
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.4153846153846154], arg1: 0.37692307692307697, arg2: 0.4153846153846154
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.4371344828559657], arg1: 0.4153846153846154, arg2: 0.4371344828559657
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.46145061663389897], arg1: 0.4371344828559657, arg2: 0.46145061663389897
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.4889858904668283], arg1: 0.46145061663389897, arg2: 0.4889858904668283
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.4996095231732179], arg1: 0.4889858904668283, arg2: 0.4996095231732179
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.49962536129670365], arg1: 0.4996095231732179, arg2: 0.49962536129670365
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.5333407915930204], arg1: 0.49962536129670365, arg2: 0.5333407915930204
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.5626822750946262], arg1: 0.5333407915930204, arg2: 0.5626822750946262
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.5941663733048309], arg1: 0.5626822750946262, arg2: 0.5941663733048309
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.6221525081979236], arg1: 0.5941663733048309, arg2: 0.6221525081979236
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.6427489898360779], arg1: 0.6221525081979236, arg2: 0.6427489898360779
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.6511656916228664], arg1: 0.6427489898360779, arg2: 0.6511656916228664
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.6781609002406684], arg1: 0.6511656916228664, arg2: 0.6781609002406684
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.7014367363219931], arg1: 0.6781609002406684, arg2: 0.7014367363219931
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.7259500858917705], arg1: 0.7014367363219931, arg2: 0.7259500858917705
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.7502698308413603], arg1: 0.7259500858917705, arg2: 0.7502698308413603
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.7746271668215516], arg1: 0.7502698308413603, arg2: 0.7746271668215516
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.7753621953130199], arg1: 0.7746271668215516, arg2: 0.7753621953130199
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.7971212698771013], arg1: 0.7753621953130199, arg2: 0.7971212698771013
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.7978113746702923], arg1: 0.7971212698771013, arg2: 0.7978113746702923
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8246883429436381], arg1: 0.8045146825367253, arg2: 0.8246883429436381
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8506063568503134], arg1: 0.8246883429436381, arg2: 0.8506063568503134
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8658103758125865], arg1: 0.8506063568503134, arg2: 0.8658103758125865
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8897690876754529], arg1: 0.8658103758125865, arg2: 0.8897690876754529
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8986044176113637], arg1: 0.8897690876754529, arg2: 0.8986044176113637
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8994287053144517], arg1: 0.8986044176113637, arg2: 0.8994287053144517
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8994895637143085], arg1: 0.8994287053144517, arg2: 0.8994895637143085
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8996659228140144], arg1: 0.8994895637143085, arg2: 0.8996659228140144
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.899756240085032], arg1: 0.8996659228140144, arg2: 0.899756240085032
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8999302539945363], arg1: 0.899756240085032, arg2: 0.8999302539945363
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8999779051067591], arg1: 0.8999302539945363, arg2: 0.8999779051067591
message changed: ReadOnlyStringProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: message, value: Loading complete], arg1: Loading http://www.nytimes.com/, arg2: Loading complete
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 1.0], arg1: 0.8999779051067591, arg2: 1.0
old state: RUNNING, new state: SUCCEEDED, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: state, value: SUCCEEDED].scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8045146825367253], arg1: 0.7978113746702923, arg2: 0.8045146825367253
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8246883429436381], arg1: 0.8045146825367253, arg2: 0.8246883429436381
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8506063568503134], arg1: 0.8246883429436381, arg2: 0.8506063568503134
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8658103758125865], arg1: 0.8506063568503134, arg2: 0.8658103758125865
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8897690876754529], arg1: 0.8658103758125865, arg2: 0.8897690876754529
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8986044176113637], arg1: 0.8897690876754529, arg2: 0.8986044176113637
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8994287053144517], arg1: 0.8986044176113637, arg2: 0.8994287053144517
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8994895637143085], arg1: 0.8994287053144517, arg2: 0.8994895637143085
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8996659228140144], arg1: 0.8994895637143085, arg2: 0.8996659228140144
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.899756240085032], arg1: 0.8996659228140144, arg2: 0.899756240085032
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8999302539945363], arg1: 0.899756240085032, arg2: 0.8999302539945363
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 0.8999779051067591], arg1: 0.8999302539945363, arg2: 0.8999779051067591
message changed: ReadOnlyStringProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: message, value: Loading complete], arg1: Loading http://www.nytimes.com/, arg2: Loading complete
Process changed: ReadOnlyDoubleProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: progress, value: 1.0], arg1: 0.8999779051067591, arg2: 1.0
old state: RUNNING, new state: SUCCEEDED, arg0: ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@4d8ed331, name: state, value: SUCCEEDED]
从输出中,似乎WebView已经加载了nytimes.com。但是,WebView从不显示更新。
有没有人对可能出错的地方有什么想法,或有关如何获取有关WebView内部内容的更多信息的建议?
我在Java 7和8中看到了相同的行为。
编辑:如果有人要求提供其他信息或调试输出,我很乐意提供。
编辑:这是由与JavaFX / Swing集成无关的其他代码中的错误引起的。谢谢大家的建议!
答案 0 :(得分:1)
这是一个关于如何做到这一点的完整工作示例。将来请发布一个MCVE,特别是因为你参与了Swing并且只发布了JavaFX代码的某些部分。
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class SwingBrowser extends JPanel {
WebEngine webEngine;
private static void initAndShowGUI() {
JFrame frame = new JFrame();
frame.add(new SwingBrowser());
frame.setSize(1024, 768);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public SwingBrowser() {
JPanel toolbar = new JPanel();
toolbar.setLayout(new FlowLayout());
JButton button;
button = new JButton("Google");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
loadPage("http://www.google.com");
}
});
toolbar.add(button);
button = new JButton("NY Times");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
loadPage("http://www.nytimes.com");
}
});
toolbar.add(button);
final JFXPanel fxPanel = new JFXPanel();
setLayout(new BorderLayout());
add(fxPanel, BorderLayout.CENTER);
add(toolbar, BorderLayout.NORTH);
Platform.runLater(new Runnable() {
@Override
public void run() {
initFX(fxPanel);
}
});
}
private void loadPage(String url) {
Platform.runLater(new Runnable() {
@Override
public void run() {
webEngine.load(url);
}
});
}
private void initFX(JFXPanel fxPanel) {
Scene scene = createScene();
fxPanel.setScene(scene);
}
private Scene createScene() {
WebView webView = new WebView();
webEngine = webView.getEngine();
webEngine.getLoadWorker().progressProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> arg0, Number arg1, Number arg2) {
System.out.println("Process changed: " + arg0 + ", arg1: " + arg1 + ", arg2: " + arg2);
}
});
webEngine.getLoadWorker().messageProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> arg0, String arg1, String arg2) {
System.out.println("message changed: " + arg0 + ", arg1: " + arg1 + ", arg2: " + arg2);
}
});
webEngine.getLoadWorker().exceptionProperty().addListener(new ChangeListener<Throwable>() {
@Override
public void changed(ObservableValue<? extends Throwable> arg0, Throwable arg1, Throwable arg2) {
System.out.println(arg0);
System.out.println(arg1);
System.out.println(arg2);
}
});
webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<Worker.State>() {
@Override
public void changed(ObservableValue<? extends Worker.State> arg0, Worker.State arg1, Worker.State arg2) {
System.out.println("old state: " + arg1 + ", new state: " + arg2 + ", arg0: " + arg0);
}
});
webEngine.load("http://www.google.com");
BorderPane bp = new BorderPane();
bp.setCenter(webView);
Scene scene = new Scene(bp);
return (scene);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
initAndShowGUI();
}
});
}
}