JavaFX Swing Browser Very Slow

I am trying to call something like a JFrame to authenticate a user using O-Auth. I met all background requirements for authentication, tested using the default call:

Desktop.getDesktop().browse(java.net.URI.create(url));

Using the default browser works the same way it does. Then I tried to create my owh webview to call in my application. Looking around, I found an oracle implementation of Oracle's JavaFX + Swing Example . The Oracle implementation is working, but very slow. I copied and pasted the code in eclipse and ran the class under java8.

When I abandoned the Oracle example, I found this: which is faster and cleaner, but when I call Application.launch(args);, my application freezes.

public class Test extends Application {
    @Override
    public void start(Stage stage) throws Exception {
        StackPane root = new StackPane();

            WebView view = new WebView();
        WebEngine engine = view.getEngine();
        engine.load("http://www.google.com.br/");
        root.getChildren().add(view);

        Scene scene = new Scene(root, 800, 600);
        stage.setScene(scene);
        stage.show();
    }

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

    }
}

If I could call Application.launch(args);in another thread, that would be enough.

webView ?

+2
1

, - JavaFX 8u25 JavaFX 8u40:

, WebView Swing JavaFX. , Oracle , WebView 800 , WebView 800 . , WebView , , .

, http://www.google.com.br/ WebView 1024x768, WebView Swing wrapped JavaFX - ( 2,5 ). Retina Mac OS X 10.9 Java 8u40.

Java 9 ( ). Java 9, , , .

, WebView 800x600.

, , , , . , , JavaFX , Swing, JavaFX WebView () .

- , ( , - oracle google), mcve, .

Swing, JFXPanel WebView (, Oracle SimpleSwingBrowser) , JavaFX Swing. JavaFX, JavaFX ( JavaFX ).

+1

Source: https://habr.com/ru/post/1667655/


All Articles