In JFX 1.3 I usually use binds to determinate layout position by computing bounds values from nodes of a scene or node.
But in my first project a big surprise when used y.setTranslateX(x.getTranslateX()+x.getWidht()). Widht always was 0 (zero). By default I always create all nodes and UI components before to put they in scene.
Posting a bug report to JavaFX 2.0 team a received an answer that was enlightening to me and can be to many other programers.
Amy Fowler added a comment - Jul, 14 2011 12:25 AM
The size of resizable nodes (Regions, Panes, Controls) depends on CSS being applied since style information (fonts, padding, etc) contributes to the preferred and ultimately (after layout) the actual size of such nodes. CSS cannot be applied until nodes are connected to a Scene because stylesheets are set at the Scene level. Currently CSS is not applied until the first pulse on the scene, which doesn't happen until the Scene is visible on the screen.
Nenhum comentário:
Postar um comentário