Scrollable field with non-editable text

508 Views Asked by At

In my app I need a scrollable field with non-editable text with custom size. I'm trying to do this like below:

final int sx2 = Display.getWidth()-Display.getWidth()*2/51-kButtonWidgh;
final int sy2 = Display.getHeight()*7/12;
VerticalFieldManager vfm3 = new VerticalFieldManager()
        {

         public void sublayout( int maxWidth, int maxHeight )
         {
             super.sublayout(sx2, sy2);
         }
        };
        text = new TextField((Field.FOCUSABLE & Field.READONLY & Field.STATUS_MOVE_FOCUS_HORIZONTALLY)){
            public void layout( int maxWidth, int maxHeight ) {
                super.layout(sx2, sy2);   //my custom frame
                }
            };
        vfm3.add(text);
        vfm2.add(vfm3);

But it editable, and not scrollable. Text prints from beginning field and ends far away from it's frame. there is cursor, which goes out of field frame, and there is no scrolling. How should I do this?

1

There are 1 best solutions below

1
On BEST ANSWER

try this:

EditField _text = new EditField(Field.HORIZONTAL_SCROLL|Field.VERTICAL_SCROLL);
_text.setEditable(false);