Skip to main content

Problem with editable TextArea

3 replies [Last post]
oluz
Offline
Joined: 2006-05-04
Points: 0

Hi,

I tried to create an editable TextArea and when I select it (to edit the pre-defined text) I got the exception:

java.lang.IllegalArgumentException
at javax.microedition.lcdui.TextField.setChars(+105)
at javax.microedition.lcdui.TextField.setString(+27)
at javax.microedition.lcdui.TextBox.setString(+8)
at com.sun.lwuit.Implementation.editString(+120)
at com.sun.lwuit.Display.editString(+8)
at com.sun.lwuit.TextArea.onClick(+14)
at com.sun.lwuit.TextArea.keyReleased(+32)
at com.sun.lwuit.Form.keyReleased(+93)
at com.sun.lwuit.Implementation.handleEvent(+77)
at com.sun.lwuit.Implementation.edtLoopImpl(+140)
at com.sun.lwuit.Implementation.mainEDTLoop(+105)
at com.sun.lwuit.Implementation.run(+4)

I played around a bit and it looks like there's a problem with the length of the pre-defined text in the TextArea. In my tests it crashed when it exceeds 125 characters. Tested on Sony Ericsson emulator (JP-8) and a SE-JP-8 phone.

Here's the source code to reproduce the exception:
...
Form f = new Form();
f.setTitle("Hello World");
f.setLayout(new BorderLayout());
TextArea ta = new TextArea("01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234");
f.addComponent("South", ta);
f.show();
...

Oh, I use version LWUIT_20080605

In case of questions, let me know.

Cheers ;)
Dominik

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dunae
Offline
Joined: 2008-06-09
Points: 0

The problem is that by default textarea allows 125 characters. You have to change the length if you are going to introduce more characters by default.

ta.setMaxSize(200); //for example

chen

Hi,
Thanks for reporting this, we will investigate and fix for the next drop.

Chen

lwuit-users@mobileandembedded.org wrote:
> The problem is that by default textarea allows 125 characters. You have to change the length if you are going to introduce more characters by default.
>
> ta.setMaxSize(200); //for example
> [Message sent by forum member 'dunae' (dunae)]
>
> http://forums.java.net/jive/thread.jspa?messageID=279123
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

oluz
Offline
Joined: 2006-05-04
Points: 0

Thanks for looking into it!