Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code> According to your requirement , this Sample class will help you .. import net.rim.device.api.ui.*; public class JustifiedEvenlySpacedHorizontalFieldManager extends Manager { private static final int SYSTEM_STYLE_SHIFT = 32; public JustifiedEvenlySpacedHorizontalFieldManager() { this( 0 ); } public JustifiedEvenlySpacedHorizontalFieldManager( long style ) { super( USE_ALL_WIDTH | style ); } protected void sublayout( int width, int height ) { int availableWidth = width; int numFields = getFieldCount(); int maxPreferredWidth = 0; int maxHeight = 0; // There may be a few remaining pixels after dividing up the space // we must split up the space between the first and last buttons int fieldWidth = width / numFields; int firstFieldExtra = 0; int lastFieldExtra = 0; int unUsedWidth = width - fieldWidth * numFields; if( unUsedWidth &gt; 0 ) { firstFieldExtra = unUsedWidth / 2; lastFieldExtra = unUsedWidth - firstFieldExtra; } int prevRightMargin = 0; // Layout the child fields, and calculate the max height for( int i = 0; i &lt; numFields; i++ ) { int nextLeftMargin = 0; if( i &lt; numFields - 1 ) { Field nextField = getField( i ); nextLeftMargin = nextField.getMarginLeft(); } Field currentField = getField( i ); int leftMargin = i == 0 ? currentField.getMarginLeft() : Math.max( prevRightMargin, currentField.getMarginLeft() ) / 2; int rightMargin = i &lt; numFields - 1 ? Math.max( nextLeftMargin, currentField.getMarginRight() ) / 2 : currentField.getMarginRight(); int currentVerticalMargins = currentField.getMarginTop() + currentField.getMarginBottom(); int currentHorizontalMargins = leftMargin + rightMargin; int widthForButton = fieldWidth; if( i == 0 ) { widthForButton = fieldWidth + firstFieldExtra; } else if( i == numFields -1 ) { widthForButton = fieldWidth + lastFieldExtra; } layoutChild( currentField, widthForButton - currentHorizontalMargins, height - currentVerticalMargins ); maxHeight = Math.max( maxHeight, currentField.getHeight() + currentVerticalMargins ); prevRightMargin = rightMargin; nextLeftMargin = 0; } // Now position the fields, respecting the Vertical style bits int usedWidth = 0; int y; prevRightMargin = 0; for( int i = 0; i &lt; numFields; i++ ) { Field currentField = getField( i ); int marginTop = currentField.getMarginTop(); int marginBottom = currentField.getMarginBottom(); int marginLeft = Math.max( currentField.getMarginLeft(), prevRightMargin ); int marginRight = currentField.getMarginRight(); switch( (int)( ( currentField.getStyle() &amp; FIELD_VALIGN_MASK ) &gt;&gt; SYSTEM_STYLE_SHIFT ) ) { case (int)( FIELD_BOTTOM &gt;&gt; SYSTEM_STYLE_SHIFT ): y = maxHeight - currentField.getHeight() - currentField.getMarginBottom(); break; case (int)( FIELD_VCENTER &gt;&gt; SYSTEM_STYLE_SHIFT ): y = marginTop + ( maxHeight - marginTop - currentField.getHeight() - marginBottom ) &gt;&gt; 1; break; default: y = marginTop; } setPositionChild( currentField, usedWidth + marginLeft, y ); usedWidth += currentField.getWidth() + marginLeft; prevRightMargin = marginRight; } setExtent( width, maxHeight ); } } please have a look on this link :- [http://supportforums.blackberry.com/t5/Java-Development/Implement-advanced-buttons-fields-and-managers/ta-p/488276][1] you will get all kinds of Custom Components Cheers ..!!! [1]: http://supportforums.blackberry.com/t5/Java-Development/Implement-advanced-buttons-fields-and-managers/ta-p/488276 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload