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

editfield with non editable action and multi line

Hello,

         i want edit field with non editable. its look like lable. i juse folling code but not work.

any one tel me where i was wrong??

 

EditField edges=new EditField(EditField.NO_NEWLINE | EditField.NO_EDIT_MODE_INPUT);

        please help me frnd.

 

       i also use my one edit fild when i enter data in edit fild it wil go multilne. how we give fiix tex size for

editfild. i use following code for editfield.

 

EditField edName=new EditField(EditField.NO_NEWLINE |EditField.FILTER_EMAIL)
    {
        //to add rectangle(border) around edit field    
        protected void paint(Graphics g)
        {
            g.clear();
            g.drawRect(0, 0, (int)(Display.getWidth()/1.5),edName.getHeight()/*(int)(Display.getHeight()/9)*/);    
            super.paint(g);            
        }    
    };

 

but when i enter more than one line it goes to second line. pls tel me where i wrong.

                    thanks,

                        ajay

 

 

 

Please use plain text.
Developer
BB-Dude
Posts: 516
Registered: ‎07-23-2010

Re: editfield with non editable action and multi line

First of all you can edit text in a read only edit field unless you are programing it.

Why don't you use a LabelField if you don't want the user to edit it and also the LabelField is one line.

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

Re: editfield with non editable action and multi line

do u want your contents to scroll inside the edit field when data goes beyond 1 line:

 

for that put your editfield inside a horizontalFieldmanager enabled with Horizontal scroll

u must create the editfield with property : no new line

Please use plain text.
Developer
arsenk01
Posts: 91
Registered: ‎06-21-2011
My Carrier: developer

Re: editfield with non editable action and multi line

if you want your EditField not be editable just override  it's keyChar method :

 

protected boolean keyChar(char key, int status, int time) {
        return true;
    //    return super.keyChar(key, status, time);
}

Regards,
Arsen
Please use plain text.
Visitor
vighneshwar
Posts: 1
Registered: ‎07-07-2011
My Carrier: student

Re: editfield with non editable action and multi line

the property editfield.No_NewLine will work fine for single line but if u want to fix the text in single line u must generate an event for fixed number of charcters will enter into the editfield.

Please use plain text.