javafx-webengine

JavaFX WebView Context Menu

六月ゝ 毕业季﹏ 提交于 2019-12-12 03:48:05
问题 I am trying to implement a simple browser using the JavaFX WebView/WebEngine inside of an SWT application using the FXCanvas. For some reason, the inbuilt context menu (with things like Refresh Copy/Paste etc.) does not seem to be working. If I create my own JavaFX context menu then it works, but I can't find a way to determine what HTML element is under the mouse at a given point (i.e. to have different menu items for links vs. images) A simple example that shows this behavior: import org

Why can't I embed Ace Editor into WebView?

旧时模样 提交于 2019-12-12 01:03:42
问题 I am attempting to make a simple editor in JavaFX 2.2. I downloaded Ace Editor repository and created a test page which works fine when double clicked. However, it does not work when I try to embed it into the WebView . SSCCE : package web; import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.SceneBuilder; import javafx.scene.layout.StackPane; import javafx.scene.layout.StackPaneBuilder; import javafx.scene.web.WebEngine; import

On which thread JavaFX change listeners are executed ?

家住魔仙堡 提交于 2019-12-10 23:35:08
问题 Is the code added in following document change listener will always get executed in JavaFX application thread ? webEngineObject.documentProperty().addListener(new ChangeListener<Document>(){ @Override public void changed( ObservableValue<? extends Document> arg0, Document arg1, Document arg2) { //some code here } }); Or do I need to add Platform.runLater() ? When I looked at thread stack after hitting a breakpoint there, it looks like code was getting executed in JavaFX Application Thread

Javafx: No toolkit found exception

蓝咒 提交于 2019-12-10 16:10:35
问题 I have added the javafx library in my intellij plugin for adding the jfxwebview. But when I am trying to create JFXPanel object as JFXPanle jfxpanel = new JFXPanel(); It is giving the following exception: No toolkit found java.lang.RuntimeException: No toolkit found at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:217) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209) at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:215) at javafx.embed.swing.JFXPanel.<init>

JavaFX edit WebView in FXML document

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 10:52:29
问题 My goal is to be able to put html content into a WebView object in the fxml document using the controller class. My FXML document has other objects in it like buttons and images, I want the WebView just to be part of the GUI. I can put content inside a TextArea in the FXML document using the controller class. Doing this for WebView is a bit more tricky because it requires a WebEngine to go along with it. I know how to launch a WebView by itself without am FXML doc but does anyone know if my

How to stop WebEngine after closing stage JavaFX?

你说的曾经没有我的故事 提交于 2019-12-09 01:04:03
问题 When i create new stage with WebEngine that playing video from YouTube, after i close it - Youtube keeps playing on backgroung. If i use "Platform.exit" - its close all my JavaFX App, but i want to close only stage that been created for YouTube. This is my class for YouTube player: public class YouTube_player { public YouTube_player(String url) { final Group root = new Group(); Scene scene = new Scene(root, 820, 480); final Stage stage = new Stage(); final WebView webView = new WebView();

JavaFX: in WebView img tag is not loading local images

风流意气都作罢 提交于 2019-12-07 19:47:57
问题 Following is my code every thing is fine I can load a remote page I can put html content but my img tag shows a X sign means it is not able to load the images. Note: my images are located in the same package with the class JavaFX in a folder Smiley and I can list all the images means there is not problem with the path import java.awt.BorderLayout; import java.io.File; import javafx.application.Platform; import javafx.embed.swing.JFXPanel; import javafx.scene.Group; import javafx.scene.Scene;

JavaFX WebEngine wait for ajax to complete

对着背影说爱祢 提交于 2019-12-07 05:08:22
问题 I'm developing a data mining application in JavaFX which relies on the WebView (and thus also the WebEngine). The mining happens in 2 steps: first the user uses the UI to navigate to a website in the WebView to configure where interesting data can be searched. Second, using a background task that periodically runs, a WebEngine loads the same document and tries to extract the data from the loaded document. This works perfectly for most cases but recently I've ran into some trouble with pages

JavaFX: in WebView img tag is not loading local images

泪湿孤枕 提交于 2019-12-06 10:06:48
Following is my code every thing is fine I can load a remote page I can put html content but my img tag shows a X sign means it is not able to load the images. Note: my images are located in the same package with the class JavaFX in a folder Smiley and I can list all the images means there is not problem with the path import java.awt.BorderLayout; import java.io.File; import javafx.application.Platform; import javafx.embed.swing.JFXPanel; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javax.swing.JFrame; import

JavaFX JSObject stop working after a few minutes?

一笑奈何 提交于 2019-12-06 04:45:39
问题 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>