# Processing and JavaFX

**URL:** <https://discourse.processing.org/t/processing-and-javafx/45692>\
**Category:** Libraries\
**Created:** [February 1, 2025, 6:04pm UTC](https://discourse.processing.org/t/processing-and-javafx/45692 "2025-02-01T18:04:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [February 4, 2025, 4:00pm UTC](https://discourse.processing.org/t/processing-and-javafx/45692/5 "2025-02-04T16:00:34Z")

</div>

Hello folks!

I can run JavaFX code examples (links below) with:

- Windows 10 Pro 22H2
- Processing 4.3.2

Steps:

- Install the _JavaFX library_.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/2/f/2f1e1245847537c9e3c64bca055fa0130a17b0f3.png)

- Import the _JavaFX library_ in your code:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/9/3/93e334253f21700dad689f7a798685fe2337762b.png)

- Add the _JavaFX modules_ (_jar files_ in _modules folder)_ to your sketch folder.  
_I have some code below to assist with finding them._  
The simplest way to do this is to _drag and drop_ them into your sketch window.  
This will create a folder called _code_ that contains them.  
Or…  
You cold also manually create a folder called _code_ and copy the _JavaFX modules_ into this.

- I suggest you create a code template that contains these _JavaFX modules_ for future use!  
You then _“Save as”_ a new sketch to use in future.

I am able to run these examples from the forum _ **with steps provided in this post** _ for _ **W10 and Processing 4.3.2** _:

- [Multiplication Table for JavaFX](https://discourse.processing.org/t/multiplication-table-for-javafx/45685)
- [JavaFX WebView Preview](https://discourse.processing.org/t/javafx-webview-preview/41343)
- [JavaFX Controls Preview](https://discourse.processing.org/t/javafx-controls-preview/41353)
- There may be more… do a search!

Code to assist with finding the _JavaFX modules folder_:

```auto
// Assist with finding JavaFX modules and open folder
// Opens the folder on a Windows 10 system
// Author: glv
// Date: 2025-02-04

// Insight gleaned from various sources; seek and you shall find.

// Note:
// It only works with a new sketch name starting with "sketch" !
// You MUST save the sketch folder first !
// If you don't save it it points the %temp% directory.

import java.awt.Desktop;
import java.io.File;
import java.io.IOException;

void setup()
  {
  String sp = sketchPath("");  
  println(sp);
  
  String path = sp.substring(0, sp.indexOf("\\sketch"));
  println(path);
  path = path + "\\libraries\\javafx\\library\\windows-amd64\\modules";
  
  println();
  println("This is where the JavaFX modules are:");
  println(path);

  // Specify the path of the folder you want to open
  File folder = new File(path);

  if (folder.exists() && folder.isDirectory()) 
    {
    try 
      {
      Desktop.getDesktop().open(folder);
      } 
    catch (IOException e) 
      {
      e.printStackTrace();
      }
    } 
  else 
    {
    System.out.println("The specified folder does not exist or is not a directory.");
    }
  }

```

Output:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/a/8/a8dc71f75d1e322e49a937d7eb37eeee7c3706d7.png)

Opens this folder on my system:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/4/6/469e2598632d5b0b60b1ba726e84c2083166dd0c.png)

I encourage you to explore the references below to help understand and navigate this.  
There are some menu items in the Processing PDE to explore that are very useful!

Additional references:

- [Libraries - Happy Coding](https://happycoding.io/tutorials/processing/libraries#adding-a-library-jar)
- [Environment / Processing.org](https://processing.org/environment/)

And there is main Processing website!

> **[Welcome to Processing!](https://processing.org/)**
>
> Processing is a flexible software sketchbook and a language for learning how to code. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology…

Have fun!

`:)`

---

_[View the full topic](https://discourse.processing.org/t/processing-and-javafx/45692)._
