/ ब्लैकबेरी (जावा) के लिए पासवर्ड और न्यूमेरिक संकेत - ब्लैकबेरी, पासवर्ड, संख्यात्मक

ब्लैकबेरी (जावा) के लिए पासवर्ड और संख्यात्मक संकेत - ब्लैकबेरी, पासवर्ड, संख्यात्मक

एक ब्लैकबेरी ऐप बनाना।

बस एक शुरुआत, मैंने खोजा है, लेकिन वह नहीं कर सकाइसके लिए एक समाधान खोजें, हालांकि यह आम है। अगर कोई मुझे बता सकता है कि जावा में ब्लैकबेरी अनुप्रयोगों के लिए एक पासवर्ड संकेत और एक संख्यात्मक संकेत कैसे दिखाया जाए। अग्रिम में धन्यवाद!!

उत्तर:

जवाब के लिए 3 № 1
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

जवाब के लिए 0 № 2

विशिष्ट होने के लिए आपका प्रश्न बहुत व्यापक हैउत्तर दें, लेकिन जो मैं मानता हूं, उसे देखते हुए कि आप पाठ क्षेत्र के ठीक ऊपर या नीचे एक लेबल के बारे में बात कर रहे हैं ताकि उपयोगकर्ता को यह पता चल सके कि क्षेत्र को क्या चाहिए। इस स्थिति में आप एक पुष्टिकरण स्क्रीन प्रदान कर सकते हैं जहाँ उपयोगकर्ता को फ़ील्ड की आवश्यकता दिखाई जाए जैसे फ़ील्ड रिक्त नहीं हो सकती, या फ़ील्ड में केवल संख्यात्मक मान हो सकते हैं, आदि।

आप डिवाइस डेटाबेस पर पासवर्ड संकेत स्टोर कर सकते हैं और जब उपयोगकर्ता इसे गलत तरीके से दर्ज करता है, तो स्क्रीन पर लेबल फ़ील्ड को संकेत के साथ प्रदर्शित किया जाता है।

कुछ इस तरह:

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