JavaFX Empty Path Issue

With rendering glitches

WITHOUT rendering glitches

Some time ago I stumbled upon an issue with JavaFX that was generating a lot of rendering glitches, namely: objects disappearing or partially disappearing. As can be seen it the pictures. Thankfully, I was able to isolate the source of the problem and also an easy workaround.

This issue happens when you have an empty Path object on your scenegraph, that is a Path without any elements added to it. The solution: just add paths which are not empty to the scenegraph, wait till you populate the path and then only then add it to the scenegraph. Another option is to pass in the following to the JVM “-Dprism.dirtyopts=false”, this will turn off the dirty region optimization and force a complete repaint of the scene each time the scene changes.

It has been fixed on JavaFX 2.1: : http://javafx-jira.kenai.com/browse/RT-18080. However till then you’ll have to rely on this easy workaround.

Advertisements

3 thoughts on “JavaFX Empty Path Issue

  1. Blog: JavaFX Empty Path Issue | Oracle | Syngu

  2. JavaPins

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s