Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
govind23
Posts: 112
Registered: ‎05-20-2011
My Carrier: Developer

please help me how to implement Passwordfield with hint like android in blackberry

Here i want how to implement Passwordfield with hint like android

 

that means when we click on key it will display like charecter after some fraction of seconds it will change into cross mark(*)

 

please help me frnds

thanks

Please use plain text.
Contributor
Pri-Machine
Posts: 37
Registered: ‎07-26-2011
My Carrier: Non Blackberry User

Re: please help me how to implement Passwordfield with hint like android in blackberry

please share code that u r trying to do so that we will help you out with solution.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Please press the kudos button (star icon) on the left side to thank the user that helped you.
2. Please mark posts as solved if you found a solution.
- Paresh Indulkar
(Game Programmer at Synqua Games)
(Developer of games - BBM Cricket with Friends & Word Poker with Friends :smileyvery-happy: )
Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: please help me how to implement Passwordfield with hint like android in blackberry

i would suggest to extend an editfield and add some automatic text replacement while keeping the original text in a separate buffer.
you could use a timertask to replace the last character.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Trusted Contributor
govind23
Posts: 112
Registered: ‎05-20-2011
My Carrier: Developer

Re: please help me how to implement Passwordfield with hint like android in blackberry

thank u sir,

please provide me some code like where we have o use timertask to replace function?

Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: please help me how to implement Passwordfield with hint like android in blackberry

you can try to implement it, if it does not work, post your code here and maybe somebody can help.

if you need free samples you can check the samples folder or search online, but i don't know any covering this area.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Contributor
Pri-Machine
Posts: 37
Registered: ‎07-26-2011
My Carrier: Non Blackberry User

Re: please help me how to implement Passwordfield with hint like android in blackberry

	private class changeChar extends TimerTask {
public void run() {
Thread t= Thread.currentThread();
try {
t.sleep(1000); // 1000 to change char to * after 1 sec
} catch (InterruptedException e) {
e.printStackTrace();
}

// your textfield string last char set to *, use two diff strings one for display & one for your inapp use
}
}
call this class in schedular so that after 1 sec char will change to *
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Please press the kudos button (star icon) on the left side to thank the user that helped you.
2. Please mark posts as solved if you found a solution.
- Paresh Indulkar
(Game Programmer at Synqua Games)
(Developer of games - BBM Cricket with Friends & Word Poker with Friends :smileyvery-happy: )
Please use plain text.
Contributor
Pri-Machine
Posts: 37
Registered: ‎07-26-2011
My Carrier: Non Blackberry User

Re: please help me how to implement Passwordfield with hint like android in blackberry

	private class changeChar extends TimerTask {
public void run() {
Thread t= Thread.currentThread();
try {
t.sleep(1000); // 1000 to change char to * after 1 sec
} catch (InterruptedException e) {
e.printStackTrace();
}

// your textfield string last char set to *, use two diff strings one for display & one for your inapp use
}
}
create this class object in schedular so that after 1 sec char will change to *
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Please press the kudos button (star icon) on the left side to thank the user that helped you.
2. Please mark posts as solved if you found a solution.
- Paresh Indulkar
(Game Programmer at Synqua Games)
(Developer of games - BBM Cricket with Friends & Word Poker with Friends :smileyvery-happy: )
Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: please help me how to implement Passwordfield with hint like android in blackberry

do not execute sleep on a timertask.
you can schedule the timertask to run after 1 second using http://www.blackberry.com/developers/docs/6.0.0api/java/util/Timer.html#schedule(java.util.TimerTask... long)

it would make sense to schedule the replacement in the keyChar method, but i don't know if it would work with suretype and other reduced devices.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Trusted Contributor
govind23
Posts: 112
Registered: ‎05-20-2011
My Carrier: Developer

Re: please help me how to implement Passwordfield with hint like android in blackberry

inside editfield i put this

TimerTask tt=new TimerTask() {
                        public void run() {
                            editField.setText("*");
                        }
                    };t.scheduleAtFixedRate(tt, 1000, 1000);

 

but how to store key value dont know

Please use plain text.
Trusted Contributor
govind23
Posts: 112
Registered: ‎05-20-2011
My Carrier: Developer

Re: please help me how to implement Passwordfield with hint like android in blackberry

please give me clarity that how to capture key value after pressing and how to replace

 

thank u

Please use plain text.