在黑莓机中显示密码复选框? [英] Show Password check box in blackberry?
本文介绍了在黑莓机中显示密码复选框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建一个登录页面,其中使用了显示密码复选框,以便在单击该复选框时,我的密码编辑文本更改为文本数据
(例如:"****"到"1234"),请为此帮帮我.
致谢
I am creating a Log In page in which i am using a show password check box so that when i clicked that check box my password edit text change to Text data
(eg : ''****'' to ''1234''), So Help me out for this.
Thanks & Regards
推荐答案
无效.
登录期间始终会屏蔽密码.这是很平常的事.
因此,请取消选中该复选框,并将密码设为密码.
Invalid.
A password is always masked during login. That is a common thing.
So please just drop the checkbox and let the password be a password.
我已经使用以下类完成了该操作:
i have done it using the following class :
public class passwordTextField extends EditField
{
private final static String INIT_TEXT = "Enter Password";
protected void paint(Graphics graphics)
{
String originalText = getText();
String fakeText = originalText;
if (originalText.equalsIgnoreCase(""))
{
fakeText = isFocus() ? originalText : INIT_TEXT;
}
else
{
if(LogInPage.flag == true)
{
setText(originalText);
}
else
{
fakeText = "";
for (int i=0 ; i<originalText.length();i++)
{
fakeText += '*';
}
}
}
setText(fakeText);
super.paint(graphics);
setText(originalText);
}
}
并在主屏幕中按如下所示调用此类:
and call this class in main screen as follows:
passwordTextField password = new passwordTextField();
add(password);
并将更改侦听器添加到showpassword复选框
and add change listener to showpassword check box
static boolean flag = false;
public void fieldChanged(Field field, int context)
{
if(showPasswordCheckbox.getChecked() == true)
{
flag = true;
}
else
{
flag = false;
}
}
这篇关于在黑莓机中显示密码复选框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文