Stack panes arrange their children in layers, like a stack of transparencies. Unlike card panes, which show only a single component at a time, stack panes always display all of their child components. Components with a higher z-index (position within the stack pane) are painted on top of components with a lower z-index.
The following example shows a stack pane containing an image view and a label. The label is layered on top of the image:
The BXML source for the example is as follows:
<Window title="Stack Panes" maximized="true" xmlns:bxml="http://pivot.apache.org/bxml" xmlns="org.apache.pivot.wtk"> <StackPane> <ImageView image="@background.png" styles="{fill:true, preserveAspectRatio:false}"/> <Label text="StackPane Demo" styles="{font:'Helvetica bold 64', color:'#ffffff', wrapText:true, horizontalAlignment:'center', verticalAlignment:'center'}"/> </StackPane> </Window>
Since this example contains no logic, there is no associated Java source.
Next: Split Panes