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.

One thought on “JavaFX Empty Path Issue

Leave a Reply

Your email address will not be published. Required fields are marked *