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

Posts: 415
Registered: ‎07-28-2010
My Device: 8000
My Carrier: hi

editfield with non editable action and multi line


         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.drawRect(0, 0, (int)(Display.getWidth()/1.5),edName.getHeight()/*(int)(Display.getHeight()/9)*/);    


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






Posts: 516
Registered: ‎07-23-2010
My Device: 9900

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.

Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
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

Posts: 91
Registered: ‎06-21-2011
My Device: Blackberry Torch 9800
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);

Posts: 1
Registered: ‎07-07-2011
My Device: 9800
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.