Search code examples
java-melwuitnokia-s40

How to Display Multiple Lines of text using TextField in LWUIT


I have created LWUIT TextField,and I've added paragraphs of text to my TextField,But I am not able to Display the Fulltext ?I am able to Display single line of text? Here my Code:

   TextField field=new TextField(detailNews.getDescription());             
   field.setSingleLineTextArea(false);        
   field.setGrowByContent(true);       
   field.setIsScrollVisible(true);
   field.setFocus(false);
   field.setRows(detailNews.getDescription().length());     
   form2.addComponent(field);

Solution

  • TextFieldis only for a single line case. What you want to use is a TextAreaComponent. So try to change your TextFieldcomponent by a TextArea Component