fix JavaFX 2.x compatibility