I have encountered a strange behaviour in javaFx2, when moving a pane, that is bigger than the current scene. The pane has set a background-image in a css file, like:
#foo {
-fx-background-image: url("bar.png");
}
The image is rendered correctly at first, but when I move the pane (to show a different part of it in the scene), the pane is white, where it was not visible before moving and the background-image should be.
Move-code:
private void moveCameraTo(Point p) {
TranslateTransition translate = TranslateTransitionBuilder.create()
.node(pane)
` ` .toX(someX)
.toY(someY)
.duration(DEFAULT_TRANSITION_TIME)
.build();
translate.play();
}
Here is a image of the fail:

The background is rendered correctly, as soon, as I resize the scene by dragging its borders.
Am I doing something wrong while moving the pane, e.g. missing an update method (although I doubt this exists in javaFx2) or setting a member of the pane?
After a lot of searching and trying, I have come to the conclusion, that this behaviour is a bug.
A workaround for this is, to use a
ScrollPaneinstead of a plainPaneand move the “camera” by setting the vvalue and hvalue in aTimeline, like this:I hope this helps everyone having the same problem.
If anyone got a better solution, please post it!