# Webview in Processing

**URL:** <https://discourse.processing.org/t/webview-in-processing/42599>\
**Category:** Coding Questions\
**Created:** [August 16, 2023, 3:01pm UTC](https://discourse.processing.org/t/webview-in-processing/42599 "2023-08-16T15:01:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [August 17, 2023, 7:10am UTC](https://discourse.processing.org/t/webview-in-processing/42599/2 "2023-08-17T07:10:47Z")

</div>

Hi @nuhuhwy,

I think you are refering on that topic !?

> [@JavaFX WebView Preview](https://discourse.processing.org/t/javafx-webview-preview/41343):
>
> The screenshot below is a preview of a JavaFX WebView. It was created in Processing4 after adding the javafx.webview module to line 1086 of JavaBuild.java and recompiling the editor. The source code and output are shown below : Source code: import javafx.scene.Scene; import javafx.stage.Stage; import javafx.scene.layout.VBox; import javafx.scene.web.WebView; void setup() { size(1, 1, FX2D); Stage stage = new Stage(); stage.setTitle("JavaFX WebView Example"); WebView webView = new…

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)**

1. open processing pde in java mode
2. install JavaFX from the contribution manager (Libraries) if not already done
3. save your sketch, ie TestJavaFX
4. open explorer skeckbookfolder/libraries/javafx/library/windows-amd64/modules  
and for simplicity drag and drop all javafx jar’s onto your PDE.
5. copy the code from below (Code) as your sketch code and save
6. 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
7. save and close your PDE
8. 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
9. reopen the TestJavaFX project your PDE again.
10. 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**

```auto
run.options=--add-modules javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web

```

* * *

> **Code**

```auto
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();
}

```

---

_[View the full topic](https://discourse.processing.org/t/webview-in-processing/42599)._
