title: How to display buttons with background in whole width and height blackberry?
body: <p>I am displaying buttons dynamically in my app. When I am determining the number of buttons to be displayed it works fine. However, now I want to change the background color of the button on click and I am able to do that too, but only the label portion changed its color and the rest all is still the same.</p>
  
  <p>So, how can I solve this problem? Here is the code I have so far:</p>
  
  <pre><code>btn = new ButtonField[Global.vec_locdisablecityname.size()];
  
  for(int i=0;i&lt;Global.vec_locdisablecityname.size();i++){
      btn[i] = new ButtonField("",ButtonField.CONSUME_CLICK |ButtonField.FOCUSABLE);
      btn[i].setLabel((String)Global.vec_locdisablecityname.elementAt(i));
  
      if(Global.flag == true){
          Global.flag = false;
          Bitmap bmp_backbtnclick=Bitmap.getBitmapResource("bg-btn-location.png");
          Background bg_backbtnclick=BackgroundFactory.createBitmapBackground(bmp_backbtnclick);
          btn[i].setBackground(bg_backbtnclick);
      }
      else {
          if(Global.selectedbutton == i){
              Bitmap bmp_backbtnclick=Bitmap.getBitmapResource("bg-btn-location.png");
              Background bg_backbtnclick=BackgroundFactory.createBitmapBackground(bmp_backbtnclick);
              btn[i].setBackground(bg_backbtnclick);
          }
          else {
              btn[i].setBackground(null);
          }
      }
      FieldChangeListener listener = new FieldChangeListener() {
          public void fieldChanged(Field field, int context) {
              if ( field instanceof ButtonField ) {
                  for ( int i = 0; i &lt;= 1; i++ ) {
                      if ( field == btn[i] ) {
                          System.out.println("CLicked::::----&gt;&gt;&gt;" +i);
                          btn[i].setBackground(null);
                          Global.selectedbutton = i;
                          selectedcityid = Global.vec_locdisablecitycode.elementAt(i).toString();
                          System.out.println("value of selected city id:::--&gt;&gt;" +selectedcityid);
                          selectedcitycodeparse(selectedcityid);
                          selectedstartloading();
                          break;
                      }
                      else {
                          btn[i].setBackground(null);
                      }
              }
          }
          }
      };
      btn[i].setChangeListener(listener);
      hfmbuttons.add(btn[i]);
  }
  </code></pre>