Processing and JavaFX

Hello,

There are many posts in the forum using JavaFX with Processing.

JavaFX code works with certain configurations but not with others.

These configurations may include:

  • Version of Processing
  • Operating system and version
  • Modification to the source code to add modules
  • Latest build of Processing has modifications (see above) added.
  • Adding JavaFX jar files to sketch
  • Adding import statements
  • JavaFX version if applicable
  • Anything I missed…

All the topics on this can subject in this forum can complicate the journey for a new user and we need to stay on point and communicate clearly when discussing these.

I have managed to sort all of these JavaFX issues for everything but a macOS.
I rarely use JavaFX if at all but have tried some of the examples and overcame any hurdles running these.
A new use will certainly have challenges.

I suggest one clear concise communication on this in:

If I had the time I would contribute more but these days I simply do not.

A working configuration must include:

  • Operating system and version
  • Processing version
  • Additional requirements such as import statements, adding files
  • Any other details

A working configuration for my setup:

  • Windows 10 Pro 22H2
  • Processing 4.3.2
  • Adding the 7x JavaFX jar files from the modules folder to the code folder in the sketch
  • Add this to sketch:
    import processing.javafx.*;

This GitHub issue discusses some recent changes to Processing for JavaFX:

Is it a problem or a question?

Please read:

:)

Hello,

I posted this in the gallery recently but have moved it to here instead.

@svan The gallery post should include the working configuration to run the code.
Can you please add this?

It does not run on Windows 10 Pro 22H2 with Processing 4.3.2 as is:

It does run on Windows 10 Pro 22H2 with Processing 4.3.2 with some additions.

It works if I import JavaFX and drag and drop the 7 jar files (from the modules folder) onto the sketch window to add them (a folder called code is created and contains these):

I also added this to the sketch:
import processing.javafx.*;

Which will include this additional 1x required javafx.jar file:

You could include all the 8x jar files (from above) in the code folder as well and not need the import processing.javafx.*; statement.

Related:

It now works like it’s supposed to on Mac; so far I have only found one of my old files that won’t run, for reasons I don’t understand. This is without drag 'n dropping jar files. In the beginning I had to modify the editor source code to include all seven modules in order to use JavaFX which is why I made the pull request to add all of them. I also have Linux and Windows 11 systems that I rarely use and have discovered that I’m unable to run the JavaFX multiplication table demo after installing the most recent editor on each. In both cases the demo will run after drag 'n dropping the seven JavaFX module jar files onto the open sketch. That’s a problem that should be addressed. In my opinion we are missing out on using a good renderer and a nice set of JavaFX controls; graphics are a lot sharper with FX2D. For now a bug report seems to be indicated. I would like to see more input from other forum members on their experiences just to make sure they are seeing the same thing before filing the report.