import javafx.application.*; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.stage.Stage; import javafx.scene.web.*; import org.w3c.dom.*; import org.w3c.dom.events.*; import javafx.concurrent.Worker.State; import javafx.beans.value.*; import netscape.javascript.*; import java.io.*; import java.util.*; import java.lang.reflect.*; public class FatalError extends Application { Document dom = null; @Override public void start(Stage primaryStage) { // create WebView with specified local content WebView root = new WebView(); final WebEngine we = root.getEngine(); we.getLoadWorker().stateProperty().addListener( new ChangeListener() { public void changed(ObservableValue ov, State oldState, State newState) { if (newState == State.SUCCEEDED) { dom = we.getDocument(); System.out.printf("doc %b\n",dom==null); JSObject window = (JSObject) we.executeScript("window"); window.setMember("app",FatalError.this); } } }); System.out.printf("loading\n"); root.getEngine().load("file:///D:/nodewebkit/webview/index.html"); root.setZoom(javafx.stage.Screen.getPrimary().getDpi() / 96); primaryStage.setTitle("Accounting"); primaryStage.setScene(new Scene(root, 1100, 820)); primaryStage.show(); } public String delstring() { System.out.printf("-3-\n"); //return "ggg"; throw new RuntimeException("hhhhh"); } public static void main(String[] args) { System.out.printf("aaa\n"); launch(args); } }