• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java EditField类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中net.rim.device.api.ui.component.EditField的典型用法代码示例。如果您正苦于以下问题:Java EditField类的具体用法?Java EditField怎么用?Java EditField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

EditField类属于net.rim.device.api.ui.component包,在下文中一共展示了EditField类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: paint

点赞 2

import net.rim.device.api.ui.component.EditField; //导入依赖的package包/类
public void paint(Graphics g) {
    int f = getFieldCount();
    if(f > 0) {
        g.drawBitmap(0, 0, getWidth(), getHeight(), screen, 0, 0);

        Form currentForm = Display.getInstance().getCurrent();
        for(int iter = 0 ; iter < f ; iter++) {
            Field fld = getField(iter);
            int pops = 0;
            if(currentForm != null) {
                PeerComponent p = findPeer(currentForm.getContentPane(), fld);
                if(p != null) {
                    pops = clipOnLWUITBounds(p, g);
                } else {
                    Component cmp = currentForm.getFocused();

                    // we are now editing an edit field
                    if(cmp != null && cmp instanceof TextArea && cmp.hasFocus() && fld instanceof EditField) {
                        pops = clipOnLWUITBounds(cmp, g);
                        int x = fld.getLeft();
                        int y = fld.getTop();
                        g.clear(x, y, Math.max(cmp.getWidth(), fld.getWidth()),
                                Math.max(cmp.getHeight(), fld.getHeight()));
                    }
                }
            }
            paintChild(g, fld);
            while(pops > 0) {
                g.popContext();
                pops--;
            }
        }
    } else {
        g.drawBitmap(0, 0, getWidth(), getHeight(), screen, 0, 0);
    }
    g.setColor(0);
    g.drawText(debug, 0, 0);
    painted = true;
}
 

开发者ID:codenameone,
项目名称:CodenameOne,
代码行数:40,
代码来源:BlackBerryCanvas.java

示例2: EnterKeyScreen

点赞 2

import net.rim.device.api.ui.component.EditField; //导入依赖的package包/类
public EnterKeyScreen() {
  setTitle(sResources.getString(ENTER_KEY_TITLE));
  VerticalFieldManager manager = new VerticalFieldManager();
  mDescriptionText = new LabelField(sResources.getString(ENTER_KEY_HELP));
  mAccountName = new EditField(EditField.NO_NEWLINE);
  mAccountName.setLabel(sResources.getString(ENTER_ACCOUNT_LABEL));
  mKeyEntryField = new EditField(EditField.NO_NEWLINE);
  mKeyEntryField.setLabel(sResources.getString(ENTER_KEY_LABEL));
  mType = new ObjectChoiceField(sResources.getString(TYPE_PROMPT), OtpType
      .values());
  mStatusText = new LabelField() {
    protected void paint(Graphics graphics) {
      int savedColor = graphics.getColor();
      graphics.setColor(mStatusColor);
      super.paint(graphics);
      graphics.setColor(savedColor);
    }
  };
  mKeyEntryField.setChangeListener(this);
  manager.add(mDescriptionText);
  manager.add(new LabelField()); // Spacer
  manager.add(mAccountName);
  manager.add(mKeyEntryField);
  manager.add(mStatusText);
  manager.add(mType);

  HorizontalFieldManager buttons = new HorizontalFieldManager(FIELD_HCENTER);
  mSubmitButton = new ButtonField(sResources.getString(SUBMIT),
      ButtonField.CONSUME_CLICK);
  mClearButton = new ButtonField(sResources.getString(CLEAR),
      ButtonField.CONSUME_CLICK);
  mCancelButton = new ButtonField(sResources.getString(CANCEL),
      ButtonField.CONSUME_CLICK);
  mSubmitButton.setChangeListener(this);
  mClearButton.setChangeListener(this);
  mCancelButton.setChangeListener(this);
  buttons.add(mSubmitButton);
  buttons.add(mClearButton);
  buttons.add(mCancelButton);

  ApplicationDescriptor applicationDescriptor = ApplicationDescriptor
      .currentApplicationDescriptor();
  String version = applicationDescriptor.getVersion();
  mVersionText = new LabelField(version, FIELD_RIGHT | FIELD_BOTTOM);
  add(manager);
  add(buttons);
  add(mVersionText);
}
 

开发者ID:google,
项目名称:google-authenticator,
代码行数:49,
代码来源:EnterKeyScreen.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)