Skip to main content

TextArea resizes to one row.

6 replies [Last post]
nafs
Offline
Joined: 2008-06-10

Hey guys,

I was waiting for today's release because I had heard it would fix some issues related to the TextArea - well, it seems my problem was unrelated and it therefore is still there..(BTW, today's release fixes a couple of other issues, good job!)..

Anyway..
I have a TextArea which basically represents a news ticker and therefore gets updated quite often (every 5-6 seconds) by another thread. It works fine, no problem here

Th problem is tho.. my screen has several Commands, and when I click the Commands menu the popup appears in the foreground (as expected), but also suddenly the size of the TextArea gets reduced to a single line! (it kinda looks like a TextField)..
Once that happens the incoming news text doesn't fit in the TextArea and a scrollbar appears!

The strange thing is that when I click the Commands menu again, the TextArea resizes to it's original size.

This leads me to believe that there is some kind of painting/repaint problem here.. oh, and the problem is reproduced on multiple emulators and also devices. BTW, I've tried hacks like setting the rows, size, etc. doesnt work..

And here's the code I use to initialize the TextArea:
newsDisplay = new TextArea( 5, 100, TextArea.ANY | TextArea.UNEDITABLE );
newsDisplay.setPreferredSize( new Dimension( getWidth() - 10, 100 ) );

Message was edited by: nafs

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mille
Offline
Joined: 2008-06-29

Hi, I'm having exactly the same problem

nafs
Offline
Joined: 2008-06-10

millie, can you elaborate on your problem further so that we can narrow down to a solution?

A guy in another thread is also having the same problem ( http://forums.java.net/jive/thread.jspa?threadID=42980&tstart=0 )

chenf
Offline
Joined: 2008-04-29

That was a bug in TextArea, the fix will be available in the next drop.

Regards,
Chen

nafs
Offline
Joined: 2008-06-10

"[i]That was a bug in TextArea, the fix will be available in the next drop.[/i]"

Hopefully you are referring to the same bug described in the beginning of this thread by me? :)

In any case, thanks for your hardwork. When can we expect the next drop.

Message was edited by: nafs

Shai Almog

Hi Nafs,
Did you use the correct constructor for the text area which accepts
both rows and columns?
By default a text area will display in one line, this is clarified
more in the newer javadocs.

Thanks,
Shai.

> Hey guys,
>
> I was waiting for today's release because I had heard it would fix
> some issues related to the TextArea - well, it seems my problem was
> unrelated and it therefore is still there..(BTW, today's release
> fixes a couple of other issues, good job!)..
>
> Anyway..
> I have a TextArea which basically represents a news ticker and
> therefore gets updated quite often (every 5-6 seconds) by another
> thread. It works fine, no problem here
>
> Th problem is tho.. my screen has several Commands, and when I
> click the Commands menu the popup appears in the foreground (as
> expected), but also suddenly the size of the TextArea gets reduced
> to a single line! (it kinda looks like a TextField)..
> Once that happens the incoming news text doesn't fit in the
> TextArea and a scrollbar appears!
>
> The strange thing is that when I click the Commands menu again, the
> TextArea resizes to it's original size.
>
> This leads me to believe that there is some kind of painting/
> repaint problem here.. oh, and the problem is reproduced on
> multiple emulators and also devices.
> [Message sent by forum member 'nafs' (nafs)]
>
> http://forums.java.net/jive/thread.jspa?messageID=282615
>
> ---------------------------------------------------------------------
> 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

nafs
Offline
Joined: 2008-06-10

yes.

Something tells me the auto-notify feature of this forum doesn't show edited posts ;)