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.

inside custom component

Java Development

Reply
Developer
Posts: 415
Registered: ‎07-28-2010
My Device: 8000
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

Developer
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: Edit field with password.

 

PasswordEditField  pwd = new PasswordEditField ();

 

try the above code

 

Highlighted
Developer
Posts: 468
Registered: ‎08-07-2009
My Device: Curve, Bold, Storm
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.