JavaFX - Custom Layout


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>


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..


<script type="text/javascript">var dzone_style = '2';</script> <script language="javascript" src="/rakeshmenonp/resource/PanelLayout/zoneit.js"></script>

Comments:

Post a Comment:
Comments are closed for this entry.
About


The views expressed on this blog are my own and do not necessarily reflect that of my organization

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today