Browse Source

BBSDialog.this

master
vito 9 years ago
parent
commit
efb1cfb769
  1. 5
      designer/src/com/fr/design/mainframe/bbs/BBSDialog.java

5
designer/src/com/fr/design/mainframe/bbs/BBSDialog.java

@ -37,8 +37,6 @@ public class BBSDialog extends UIDialog {
private JFXPanel jfxPanel;
private BBSDialog that;//保存一个引用给问页面调用
public BBSDialog(Frame parent) {
super(parent);
@ -46,7 +44,6 @@ public class BBSDialog extends UIDialog {
JPanel panel = (JPanel) getContentPane();
initComponents(panel);
setSize(new Dimension(OUTER_WIDTH, OUTER_HEIGHT));
that = this;
}
private void initComponents(JPanel contentPane) {
@ -90,7 +87,7 @@ public class BBSDialog extends UIDialog {
view.setPrefSize(widthDouble, heightDouble);
final WebEngine eng = view.getEngine();
JSObject obj = (JSObject) eng.executeScript("window");
obj.setMember("BBSWebBridge", that);//一定要在load页面之前加载接口
obj.setMember("BBSWebBridge", BBSDialog.this);//一定要在load页面之前加载接口
//webEngine的userAgent貌似支持移动设备的,任何其他浏览器的userAngent都会导致程序崩溃
//eng.setUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) Apple/WebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36");
eng.load(url);

Loading…
Cancel
Save