Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Flex Container Box Layout Container

Related Tutorials


 
 

Share on Google+Share on Google+

Box Layout Container

Advertisement
The box layout container puts its children one after the other depending on the direction specified by the direction attribute of Box container.

Box Layout Container

     

The box layout container puts its children one after the other depending on the direction specified by the direction attribute of Box container. By default, it lays its children components in vertical direction but you can change the direction to horizontal by specifying the value "horizontal" to the direction attribute.

But VBox (Vertical Box) and HBox (Horizontal Box) containers can also be used for vertical and horizontal positioning of the child components.

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Box paddingLeft="30" paddingRight="30" paddingTop="50" paddingBottom="50" width="242" backgroundColor="#ADCCD9" x="10" y="19">

<mx:TextInput/>

<mx:Button label="OK"/>

</mx:Box>

<mx:Box direction="horizontal" x="260" paddingLeft="30" paddingRight="30" paddingTop="50" paddingBottom="50" backgroundColor="#ADCCD9" y="19">

<mx:TextInput/>

<mx:Button label="OK"/>

</mx:Box>

</mx:Application>

Output:

Download the source code:

BoxLayoutContainer.zip

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 14, 2009

Related Tutorials

Discuss: Box Layout Container  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com