Blackberryアプリの作成。
初心者の私は検索しましたが、一般的ですが解決策を見つけることができませんでした。誰かがJavaでブラックベリーアプリケーションのパスワードヒントと数値ヒントを表示する方法を教えてくれたら。前もって感謝します!!
Blackberryアプリの作成。
初心者の私は検索しましたが、一般的ですが解決策を見つけることができませんでした。誰かがJavaでブラックベリーアプリケーションのパスワードヒントと数値ヒントを表示する方法を教えてくれたら。前もって感謝します!!
According to your query , you want a field that shows password hint and a numeric hint for blackberry applications ..
Well blackberry follow some different way , it will not show hint (PopUp Screen). Another way is to put some (information) Text in the [EditField][1] when EditField is empty .Here is the sample code for demonstration :-
*******************************************************
EditField _userName_edtField = new EditField()
{
protected void layout(int width, int height)
{
super.layout(width, height);
setExtent(150, height);
};
protected void paint(Graphics graphics)
{
graphics.setColor(Color.BLACK);
if(isFocus())
{
if(getTextLength() == 0)
{
setCursorPosition(0);
}
}
else
{
if(getTextLength() == 0)
{
graphics.drawText("User Name", 0, (getHeight() - getFont().getHeight()) >>1);
}
}
invalidate();
super.paint(graphics);
}
};
add(_userName_edtField);
*******************************************************
this is Just a simple EditField , you can customize the field according to your requirement if this is empty it will show "User Name" and if you enter some text the "User Name" will disappear ..
means the EditField is act like a Hint and this will help you ..!!!
[1]: http://www.blackberry.com/developers/docs/5.0.0api/index.html
あなたの質問は広すぎて具体的な答えを得ることができませんが、私が信じていることから判断すると、テキストフィールドのすぐ上または下のラベルについて話しているので、フィールドに何が必要かをユーザーに知らせることができます。この場合、フィールドを空白にすることはできない、またはフィールドに数値のみを含めることができるなどのフィールド要件がユーザーに表示される確認画面を提供できます。
パスワードヒントをデバイスデータベースに保存できます。ユーザーがパスワードヒントを間違って入力すると、画面にラベルフィールドが追加され、ヒントとして表示されます。
このようなもの:
String storedPassword = ApplicationDAO.getStoredPassword();
if(!enteredPassword.equals(storedPassword)){
LabelField hintField = new LabelField();
hintField.setText("Your hint");
mainBody.add(hintField);
}