private void createProgressMsg() {

    progressMsg = new LabelField();
    progressMsgFieldmanager = new HorizontalFieldManager(FIELD_HCENTER);
    progressMsgFieldmanager.setPadding(PADDING);
    progressMsg.setPadding(PADDING);
    progressMsgFieldmanager.add(progressMsg);
  }
Example #2
0
  public LabelField FocusableFormatLabel(
      Manager parent, net.rim.device.api.ui.Font font, final int color, String content) {
    content = content.trim();

    LabelField l_Label =
        new LabelField(content, Field.FOCUSABLE) {
          public void paint(Graphics g) {
            g.setColor(color);
            super.paint(g);
          }
        };
    l_Label.setMargin(1, 1, 1, 1);
    l_Label.setPadding(0, 0, 0, 0);
    l_Label.setFont(font);
    parent.add(l_Label);
    return l_Label;
  }
 /**
  * Create a LabelField that spans the entire width of the container with gray text and a single
  * pixel gray border at the bottom.
  *
  * @param title
  * @return
  */
 public static LabelField createGroupLabel(String title) {
   LabelField titleField =
       new LabelField(title, LabelField.USE_ALL_WIDTH) {
         protected void paint(Graphics graphics) {
           graphics.setColor(COLOR_GROUP_LABEL_FOREGROUND);
           super.paint(graphics);
         }
       };
   Font font = titleField.getFont();
   titleField.setFont(font.derive(Font.BOLD, font.getHeight() - 3));
   titleField.setPadding(new XYEdges(0, 0, 4, 0));
   titleField.setBorder(
       BorderFactory.createSimpleBorder(
           new XYEdges(0, 0, 1, 0),
           new XYEdges(0, 0, COLOR_GROUP_LABEL_BORDER, 0),
           Border.STYLE_SOLID));
   titleField.setMargin(new XYEdges(0, 0, 4, 0));
   return titleField;
 }
  public UIExampleListStyleButtonFieldScreen() {

    super(NO_VERTICAL_SCROLL | USE_ALL_HEIGHT);

    setTitle("ListStyleButtonField Example");

    Bitmap caret = Bitmap.getBitmapResource("chevron_right_black_15x22.png");

    ListStyleButtonField one = new ListStyleButtonField("Music", caret);
    one.setChangeListener(this);
    add(one);

    ListStyleButtonField two = new ListStyleButtonField("Photos", caret);
    two.setChangeListener(this);
    add(two);

    ListStyleButtonField three = new ListStyleButtonField("Extras", caret);
    three.setChangeListener(this);
    add(three);

    ListStyleButtonField four = new ListStyleButtonField("Settings", caret);
    four.setChangeListener(this);
    add(four);

    ListStyleButtonField five = new ListStyleButtonField("Shuffle Songs", 0);
    five.setChangeListener(this);
    add(five);

    _explanation = new UIExampleScreen();
    _explanation.setTitle("ListStyleButtonField Explanation");

    LabelField explanationLabel =
        new LabelField(
            "The ListStyleButtonField looks like a list row, but is just a simple button. Good for use with a small finite set of elements.");
    explanationLabel.setPadding(5, 5, 5, 5);
    _explanation.add(explanationLabel);
  }