JavaFX - Custom Layout
By Rakesh Menon on Dec 16, 2009
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.
<script src="http://dl.javafx.com/1.2/dtfx.js"></script> <script src="/rakeshmenonp/resource/PanelLayout/PanelLayout.js"></script>
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..