/ /ブラックベリーのパスワードと数値のヒント(Java)-ブラックベリー、パスワード、数値

ブラックベリー(java)のパスワードと数値のヒント - ブラックベリー、パスワード、数値

Blackberryアプリの作成。

初心者です。検索しましたが、できませんでしたその一般的な解決策を見つけてください。 Javaのブラックベリーアプリケーションのパスワードヒントと数値ヒントを表示する方法を教えてくれる人がいれば。 前もって感謝します!!

回答:

回答№1の場合は3
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

回答№2の場合は0

あなたの質問は広すぎて特定の質問を得ることができません答えますが、私が信じているのは、あなたがテキストフィールドのすぐ上または下のラベルについて話しているため、フィールドに何が必要かをユーザーに知らせることです。この場合、ユーザーが表示される確認画面を提供できます。フィールドのようなフィールドの要件は空白にできないか、フィールドに数値のみを含めることができます。

デバイスデータベースにパスワードヒントを保存し、ユーザーが間違って入力すると、ヒントとして表示されるラベルフィールドが画面に追加されます。

このようなもの:

String storedPassword = ApplicationDAO.getStoredPassword();
if(!enteredPassword.equals(storedPassword)){
LabelField hintField = new LabelField();
hintField.setText("Your hint");
mainBody.add(hintField);
}