javafx-webengine

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

安稳与你 提交于 2019-11-26 11:26:27
问题 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? 回答1: 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); } } //

How to call launch() more than once in java

北慕城南 提交于 2019-11-26 05:59:21
问题 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