Expanders

Expanders are often used to present small amounts of information to the user. Since the information may not be relevant to the user all the time, expanders allow the user to "collapse" the panel to make more room for other content, similar to rolling up a window shade. The following example demonstrates the use of the Expander component:

The BXML source for this example is as follows. It declares three expanders contained in a vertical flow pane, which itself is contained in a scroll pane. The contents of the expanders are defined in several external BXML files that are included by the main file:

            
            <Window title="Expanders" maximized="true"
                xmlns:bxml="http://pivot.apache.org/bxml"
                xmlns="org.apache.pivot.wtk">
                <Border styles="{padding:6}">
                    <ScrollPane horizontalScrollBarPolicy="fill">
                        <BoxPane orientation="vertical" styles="{fill:true,
                            padding:{left:2, right:2}}">
                            <Expander bxml:id="stocksExpander" title="Stocks">
                                <bxml:include src="stocks.bxml"/>
                            </Expander>
                            <Expander bxml:id="weatherExpander" title="Weather" expanded="false">
                                <bxml:include src="weather.bxml"/>
                            </Expander>
                            <Expander bxml:id="calendarExpander" title="Calendar" expanded="false">
                                <Calendar/>
                            </Expander>
                        </BoxPane>
                    </ScrollPane>
                </Border>
            </Window>
            
        

Since this example does not require any logic, there is no associated Java or script code.

Next: Rollups