当前位置: 首页>>代码示例>>Java>>正文


Java TextField.PASSWORD属性代码示例

本文整理汇总了Java中javax.microedition.lcdui.TextField.PASSWORD属性的典型用法代码示例。如果您正苦于以下问题:Java TextField.PASSWORD属性的具体用法?Java TextField.PASSWORD怎么用?Java TextField.PASSWORD使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.microedition.lcdui.TextField的用法示例。


在下文中一共展示了TextField.PASSWORD属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: UserForm

public UserForm(String title, IUserDecorator d) {
    super(title);
    this.usernameField = new TextField(Localization.get("form.user.name"), "", 25,
            TextField.ANY);
    this.passwordField = new TextField(Localization.get("form.user.password"), "", 10,
            TextField.PASSWORD);
    this.confirmPasswordField = new TextField(Localization.get("form.user.confirmpassword"), "",
            10, TextField.PASSWORD);
    //#if javarosa.adduser.extended
    this.userIDField = new TextField(Localization.get("form.user.userid"), "", 10,
            TextField.NUMERIC);
    //#endif
    this.choice.append(Localization.get("form.user.giveadmin"), null);

    append(this.usernameField);
    append(this.passwordField);
    append(this.confirmPasswordField);
    //#if javarosa.adduser.extended
    append(this.userIDField);
    //#endif

    this.decorator = d;
    if (d != null) {
        initMeta();
    }
    append(this.choice);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:27,代码来源:UserForm.java

示例2: LoginView

/**
 * Create a LoginView.
 * 
 * @param loginListener Listener to signal of login events
 * @param backListener Listener to signal of back button presses
 */
public LoginView(LoginListener loginListener, BackCommandListener backListener) {
    super("Login", new Item[] {});

    this.backListener = backListener;
    this.loginListener = loginListener;
    this.username = new TextField("Username", session.getUsername(), 20, TextField.NON_PREDICTIVE & ~TextField.INITIAL_CAPS_WORD);
    this.password = new TextField("Password", null, 40, TextField.PASSWORD);
    this.submit = new StringItem(null, "Submit", StringItem.BUTTON);
    submit.setDefaultCommand(submitCommand);
    submit.setItemCommandListener(this);

    setupCommands();
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:19,代码来源:LoginView.java

示例3: AddAccountForm

public AddAccountForm() {
	super("Add an account");
	userName = new TextField("Screenname:", "", 15, TextField.ANY);
	password = new TextField("Password:", "", 30, TextField.PASSWORD);
	append(userName);
	append(password);
	addCommand(new Command("Save", "Add account", Command.OK, 2));
	addCommand(new Command("Cancel", "Cancel", Command.BACK, 1));
}
 
开发者ID:wvdschel,项目名称:twitsy,代码行数:9,代码来源:AddAccountForm.java

示例4: LoginScreen

public LoginScreen(Display display) {
    super(display);

    try {
        this.userNameTextBox = new CanvasTextBox(
                this, "Login", TextField.ANY, this.maxLoginLength);
        this.userNameTextBox.setTextEditorListener(this);
        this.passwordTextBox = new CanvasTextBox(
                this, "Password", TextField.PASSWORD, this.maxLoginLength);
        this.passwordTextBox.setTextEditorListener(this);
    } catch (IllegalStateException e1) {
        // TODO Auto-generated catch block
        this.parentDisplay.setCurrent(
                new Alert("e1 " + e1),
                this);
        //e1.printStackTrace();
    }

    //Disable Password box. It will be enabled once username is not empty.
    this.passwordTextBox.setEnabled(false);

    try {
        this.exitButton = new Button(
                this, "Exit",
                new Runnable() {
                    public void run() {
                        // When Exit is tapped, close the application
                        removeItems();
                        Display.getDisplay(parent).setCurrent(null);
                        parent.notifyDestroyed();
                    }
                });
        this.loginButton = new Button(
                this, "Log in",
                new Runnable() {
                    public void run() {
                        // When Login is tapped, create a new screen and set it current
                        if(BlogWriter.isAshaPlatform())
                            removeItems();
                        EditScreen editScreen = new EditScreen(parentDisplay);
                        editScreen.setParent(parent);
                        parentDisplay.setCurrent(editScreen);
                    }
                });
        // Disable Login button - it is enabled once username and password are entered
        this.loginButton.setEnabled(false);
    } catch (Exception ex) {
        this.parentDisplay.setCurrent(
                new Alert("Cannot create controls."),
                this);
    }

    // Create the logo image
    try {
        this.logoImage = Image.createImage("midlets/blogwriter/images/LogoImage.png");
    } catch (IOException e) {
        this.parentDisplay.setCurrent(
                new Alert("Cannot create graphics."), this);
    }

    // Set the default position of items and buttons
    this.layoutControls();

    this.userNameTextBox.setVisible(true);
    if (!BlogWriter.isFullTouch() && !BlogWriter.isAshaPlatform()) {
        this.userNameTextBox.setFocused(true);
    }
    this.passwordTextBox.setVisible(true);
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:69,代码来源:LoginScreen.java

示例5: PasswordInput

/**
 * Creates a new instance of PasswordInput
 * @param caption
 * @param text
 */
public PasswordInput(String caption, String text) {
    super(caption, text, null, TextField.PASSWORD);
}
 
开发者ID:BombusMod,项目名称:BombusMod,代码行数:8,代码来源:PasswordInput.java


注:本文中的javax.microedition.lcdui.TextField.PASSWORD属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。