private void addAlignedExample ( ) { add ( new WHeading ( HeadingLevel . H2 , "WRow / WCol with column alignment" ) ) ; WRow alignedColsRow = new WRow ( ) ; add ( alignedColsRow ) ; WColumn alignedCol = new WColumn ( ) ; alignedCol . setAlignment ( WColumn . Alignment . LEFT ) ; alignedCol . setWidth ( 25 ) ; alignedColsRow . add ( alignedCol ) ; WPanel box = new WPanel ( Type . BOX ) ; box . add ( new WText ( "Left" ) ) ; alignedCol . add ( box ) ; alignedCol = new WColumn ( ) ; alignedCol . setAlignment ( WColumn . Alignment . CENTER ) ; alignedCol . setWidth ( 25 ) ; alignedColsRow . add ( alignedCol ) ; box = new WPanel ( Type . BOX ) ; box . add ( new WText ( "Center" ) ) ; alignedCol . add ( box ) ; alignedCol = new WColumn ( ) ; alignedCol . setAlignment ( WColumn . Alignment . RIGHT ) ; alignedCol . setWidth ( 25 ) ; alignedColsRow . add ( alignedCol ) ; box = new WPanel ( Type . BOX ) ; box . add ( new WText ( "Right" ) ) ; alignedCol . add ( box ) ; alignedCol = new WColumn ( ) ; alignedCol . setWidth ( 25 ) ; alignedColsRow . add ( alignedCol ) ; box = new WPanel ( Type . BOX ) ; box . add ( new WText ( "Undefined" ) ) ; alignedCol . add ( box ) ; }
Add an example showing column alignment .