Java FX and Ignition

Hi all,

it’s possible to use JavaFX objects inside a paintable canvas in Ignition?

There’s no JavaFX Canvas element currently built in to the Ignition platform, and JavaFX isn’t “officially” supported.

If you’re excited about JavaFX (like I am) and want to get your hands dirty anyway, it is possible to get it up and running in Ignition. You’ll need some programming to take advantage of it.

This is how you would do it:

  1. Enable JavaFX in the client and designer
    This can be done by editing your ignition.conf file in your Ignition/data directory. You’ll want to add the line:
    (where XX is the next number in sequence)

  2. Write a module that provides a javafx.swing.embed.JFXPanel component. ( … Panel.html) This component would then be accessible to drop on an Ignition window and script through python to add elements to the scenegraph inside the javafx scene in the canvas. On your component, you’ll want to set the “zoom-incompatible” property to true, so Ignition doesn’t try to repaint / zoom in the designer. This is necessary, since JavaFX canvases have their own rendering thread and repaint methods that work differently than standard components.

Do note that JavaFX is only installed by default on Java versions > 7u6. On early version of Java6, I believe the gateway.xml modification (which just adds a line to the .jnlp) has unpredictable consequences. (On the latest version of 6, it works fine, but just doesn’t load JavaFX since JavaFX isn’t installed by default with Java6.) The computers running the client will need JavaFX, or they won’t be able to see the component. It’s probably a good idea to test in the client whether the client’s java supports JavaFX before trying to display a screen with JavaFX components on it (to keep any ClassNotFound Exceptions from rising).

This may be much more information than you were looking for :slight_smile: Hope this answers your question.

1 Like