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
Developer
patilajayr
Posts: 404
Registered: ‎07-28-2010
My Carrier: hi

Edit field with password.

[ Edited ]

hello,

       I am new in blckberry developer. i am desing loing password screen. i want password edit field with default character " * " . please help me. what is code for that when we enter password edit field it will show only *.

                thanks

                 ajay

Please use plain text.
Developer
swati-srivastava
Posts: 282
Registered: ‎02-25-2010
My Carrier: Verizon,AT&T

Re: Edit field with password.

 

PasswordEditField  pwd = new PasswordEditField ();

 

try the above code

 

Please use plain text.
Developer
Ekansh
Posts: 468
Registered: ‎08-07-2009
My Carrier: Blackberry Developer

Re: Edit field with password.

hi,

 

swati is correct..

 

may be you can also improvize and override

 

class Password extends PasswordEditField
{
    Password(long style)
    {
        super("", "", 10, style);
    }
    protected void layout(int width, int height)
    {
        width = SizeSpec.PasswordWidth;
        height = SizeSpec.PasswordHeight;
        super.layout(width, height);
        super.setExtent(width, height);
    }
    
    public void paint(Graphics graphics)
    {
        super.paint(graphics);
        int labelWidth = getFont().getAdvance(getLabel());
        graphics.drawRect( labelWidth, 0, getWidth() - labelWidth,getHeight());  
    }
  }

----------------------------------------------------------
feel free to press the kudos button on the left side to thank the user that helped you.
please mark posts as solved if you found a solution.
Please use plain text.