javafx-webengine

JavaFX : Embedding a browser other than available webview with JavaFX

核能气质少年 提交于 2019-12-05 17:50:12
问题 I am working on a JavaFX application which contains few html,css,JS files which are rendered by the internal webkit browser. Now, the problem is the CSS animations which we have are not getting rendered smoothly in the webkit browser provided by JavaFX, but same code in Firefox or chrome is quite smoother. Also, no persistence is available(currently using variables in Java, and communication via JS for persistence). What I am looking for is there any way to integrate some headless browser, or

Is it possible to change WebView of JavaFX to Chrome

眉间皱痕 提交于 2019-12-04 10:47:36
问题 We are trying to create a desktop application which opens url with html5 canvas. We implemented it using Java 8 JavaFX. But we experiencing bad response in rendering of sketches. This working fine in Chrome browser. Is it possible to embed chrome browser in JavaFx application? 回答1: Is it possible to change WebView of JavaFX to Chrome No. Is it possible to embed chrome browser in JavaFx application? Yes. Try JCEF from the chromium embedded project instead of WebView. For a commercial solution,

JavaFX JSObject stop working after a few minutes?

早过忘川 提交于 2019-12-04 10:40:35
I'm making a web based app with Java support for some particular requests (e.g. print without choosing the printer everytime) and there is something that id driving me crazy . I use JavaFX for instantiate the browser object and everything works fine, but of course I need to make callbacks from JavaScript to Java, here is the code: ... ... we.getLoadWorker().stateProperty().addListener( new ChangeListener<Worker.State>() { @Override public void changed(ObservableValue<? extends State> observable, State oldValue, State newValue) { if ( newValue == Worker.State.SUCCEEDED ) { bridge = new Bridge()

JavaFX : Embedding a browser other than available webview with JavaFX

ⅰ亾dé卋堺 提交于 2019-12-04 01:59:38
I am working on a JavaFX application which contains few html,css,JS files which are rendered by the internal webkit browser. Now, the problem is the CSS animations which we have are not getting rendered smoothly in the webkit browser provided by JavaFX, but same code in Firefox or chrome is quite smoother. Also, no persistence is available(currently using variables in Java, and communication via JS for persistence). What I am looking for is there any way to integrate some headless browser, or some settings to make CSS animations smoother. Only thing I came across was JxBrowser, but it's

Is it possible to change WebView of JavaFX to Chrome

拟墨画扇 提交于 2019-12-03 06:24:48
We are trying to create a desktop application which opens url with html5 canvas. We implemented it using Java 8 JavaFX. But we experiencing bad response in rendering of sketches. This working fine in Chrome browser. Is it possible to embed chrome browser in JavaFx application? Is it possible to change WebView of JavaFX to Chrome No. Is it possible to embed chrome browser in JavaFx application? Yes. Try JCEF from the chromium embedded project instead of WebView. For a commercial solution, JxBrowser advertises Chromium support for JavaFX applications. I have not used either of JxBrowser or JCEF,

How can I set a JavaFX WebView as big as the scene?

≯℡__Kan透↙ 提交于 2019-12-01 22:12:25
I have a JavaFX WebView which I want to have as big as the scene on start. If I could make it resize with the scene, this would be perfect. But right now I focus just on the initial size. @Override public void start(Stage stage) { try { Scene scene = new Scene(createWebViewPane(), 1920, 1080); scene.getStylesheets().add(getClass().getResource("Styles/application.css").toExternalForm()); stage.setScene(scene); stage.show(); } catch (Exception e) { e.printStackTrace(); } } The above code creates a scene with width: 1920px, height: 1080px. createWebViewPane() creates a WebView on a pane. private

How to catch return value from javascript in javafx?

送分小仙女□ 提交于 2019-11-28 13:12:02
I am executing a javascript code in my webview of JavaFX application. I need to make it execute repeatedly whenever there is a mouse click and get the element details into a java variable. I'm using the below code and using Firebug Lite. In Firebug console, required items are printing. But I want it returned to java application. engine.documentProperty().addListener(new ChangeListener<Document>() { @Override public void changed(ObservableValue<? extends Document> prop, Document oldDoc, Document newDoc) { enableFirebug(engine); Object obj=engine.executeScript("var lastElement = null; " +

Loading local JavaScript file in WebView in Java 8u60

拟墨画扇 提交于 2019-11-28 07:59:40
问题 Until Java 8u51, the following worked fine: Have an HTML file containing <script src="javascript.js"></script> Load this HTML file into a WebView Call a function contained in javascript.js using webView.getEngine().executeScript() After switching to 8u60 however, it no longer works: Exception in thread "JavaFX Application Thread" netscape.javascript.JSException: TypeError: undefined is not a function So the file javascript.js is no longer loaded. It works when started from an IDE, where

JavaFX 8 WebEngine: How to get console.log() from javascript to System.out in java?

纵然是瞬间 提交于 2019-11-27 09:03:44
I'm using both JavaFX and the javascript engine inside JavaFX WebEngine to develop an application. I'd like to get feedback from javascript for debugging purposes. What happens to the console output inside the WebEngine? Is there any way I can access it, or redirect to System.out in java? The following code redirects console.log() to JavaBridge.log() : import netscape.javascript.JSObject; [...] public class JavaBridge { public void log(String text) { System.out.println(text); } } // Maintain a strong reference to prevent garbage collection: // https://bugs.openjdk.java.net/browse/JDK-8154127

How to call launch() more than once in java

前提是你 提交于 2019-11-26 15:32:18
How to call the launch() more than once in java i am given an exception as "ERROR IN MAIN:java.lang.IllegalStateException: Application launch must not be called more than once" I have create rest cleint in my java application when request comes it call javafx and opening webview after completing webview operarion am closing javafx windows using Platform.exit() method. when second request comes am getting this error how to reslove this error. JavaFx Application Code: public class AppWebview extends Application { public static Stage stage; @Override public void start(Stage _stage) throws