Hi @nuhuhwy,
I think you are refering on that topic !?
you don’t need to recompile the pde to get this to work … just do the following steps …
Steps to do (This example is only for windows x64, for other OS you need to adjust step 4)
- open processing pde in java mode
- install JavaFX from the contribution manager (Libraries) if not already done
- save your sketch, ie TestJavaFX
- open explorer skeckbookfolder/libraries/javafx/library/windows-amd64/modules
and for simplicity drag and drop all javafx jar’s onto your PDE. - copy the code from below (Code) as your sketch code and save
- open menu File->Preferences and click on the very bottom the link which pointed out your preferences.txt file
(an explorer window will open with the directory listed where your preferences.txt - save and close your PDE
- Open the preferences.txt in an editor, ie notepad.exe. and search for the line
run.options=
and replace it with the line from (Preferences) below and save the preferences.txt - reopen the TestJavaFX project your PDE again.
- click the run button and see what magically happens …
I know it might a bit of advance but would do the job as a show-case…
Cheers
— mnse
Preferences
run.options=--add-modules javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web
Code
import processing.javafx.*;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebView;
void setup() {
size(1, 1, FX2D);
surface.setVisible(false);
Stage stage = new Stage();
stage.setTitle("JavaFX WebView Example");
WebView webView = new WebView();
webView.getEngine().load("http://www.processing.org");
VBox vBox = new VBox(webView);
Scene scene = new Scene(vBox, 960, 600);
stage.setScene(scene);
stage.show();
}