2

We know that TextArea are not editable , so how to create an editable component which looks like a TextArea ( having the multi-line behaviour ) ?

bharath
  • 14,283
  • 16
  • 57
  • 95
  • What do you mean TextArea is not editable? By create an editable component do you mean with the attribute contenteditable="true"? – Jon Feb 03 '12 at 11:53
  • yes ! textarea has its content not editable manually ( by the keys) . – pheromix Feb 03 '12 at 11:59

2 Answers2

3

TextArea is editable. Here is how you can create editable text area:

TextArea text = new TextArea();
text.setEditable(true);
text.setSingleLineTextArea(false);

Does this not work for you?

What version of LWUIT are you using and platform are you on?

Alex Gdalevich
  • 685
  • 7
  • 15
  • I use LWUIT 1.4 and the code you gave doesn't work ; the emulator platform is Sun Java ME SDK 3.0 on windows xp. –  Feb 06 '12 at 06:21
1

Use TextField and set its setSingleLineTextArea(false). This requires LWUIT 1.5 or newer.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65