title: BlackBerry HorizontalFieldManager with two Buttons on Opposite Sides
body: <p>I have a HorizontalFieldManager with two buttons inside it. The buttons need to be placed on the far left and the far right of the screen, respectively. I know HorizontalFieldManager only puts them left-to-right, so i have to extend them.</p>
  
  <p>Here is what I did, however it yields no fruit. The buttons <strong>do</strong> appear, but too small and with no text on them (Which I already set).</p>
  
  <p>Here is my layout code.</p>
  
  <pre><code>protected void sublayout(int width, int height) {
      setPositionChild(getField(0), 0, 0);        
  
      int fieldZeroWidth   = Max(getField(0).getContentWidth(),getField(0).getPreferredWidth());
      int fieldZeroHeight  = Max(getField(0).getContentHeight(),getField(0).getPreferredHeight());
      layoutChild(getField(0), 
              fieldZeroWidth, 
              fieldZeroHeight);
      int fieldOneWidth = Max(getField(1).getContentWidth(),getField(1).getPreferredWidth());
      setPositionChild(getField(1), 
              Display.getWidth() - fieldOneWidth,
              0);
  
      int fieldOneHeight = Max(getField(1).getPreferredHeight(),getField(1).getContentHeight());
      layoutChild(getField(1), 
              fieldOneWidth, 
              fieldOneHeight
              );
  
      setExtent(Display.getWidth(), Max(getPreferredHeight(),fieldOneHeight,fieldZeroHeight));
  }
  </code></pre>
  
  <p>After I create this custom manager, I add it at the bottom with setStatus() function.</p>
  
  <p>I want the two buttons to appear on the opposite sides (which they do), however in the right size with their text displayed.</p>
  
  <p>Thanks
  The Max functions just return the biggest between the arguments, obviously.</p>