本文整理汇总了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);
}
示例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();
}
示例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));
}
示例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);
}
示例5: PasswordInput
/**
* Creates a new instance of PasswordInput
* @param caption
* @param text
*/
public PasswordInput(String caption, String text) {
super(caption, text, null, TextField.PASSWORD);
}