JavaFX – Custom Layout
December 16, 2009 2 Comments
In one of the previous post I suggested to use Layout and Layout related attributes. But it didn’t clearly demonstrate how to use that for developing an application. So here is an example which uses Panel to layout the components.
To launch click on above image or
The components can be positioned using various methods available in Container such as getManaged, getNodePrefSize, positionNode, resizeNode and layoutNode. The entire layout of components is done in onLayout function. This function will be invoked when ever there is need to layout the content nodes. We may explicitly update layout using requestLayout function.
Try it out and let me know feedback..





Pingback: JavaFX – Performance Optimization « Java, JavaFX and beyond…
Pingback: JavaFX – How to Layout « Java, JavaFX and beyond…