|
Replies:
4
-
Last Post:
Oct 21, 2008 2:48 AM
by: cknappe
|
|
|
|
|
|
|
NullPointerException in TextArea
Posted:
Oct 19, 2008 11:04 PM
|
|
|
Hi,
sometimes I get a NullPointerException when calling setText() on a TextArea. This is the trace...
NullPointerException No detail message gaia_final-1 TextArea getLines 0xBD26 gaia_final-1 TextArea isScrollableY 0xBAA6 gaia_final Component isScrollable 0x1604 gaia_final Component <private> 0x1568 gaia_final Component paintInternal 0x1CF4 gaia_final Component paintComponent 0x137C gaia_final Component paintComponent 0x1265 gaia_final-1 Implementation paintDirty 0x7A17 gaia_final-1 Implementation edtLoopImpl 0x7CD7 gaia_final-1 Implementation <private> 0x83A7 net_rim_cldc-1 Thread run 0xB4B7
I am using the lib from 14.08.2008 so I don't know if this has been fixed at all.
Regards, Christian
|
|
|
|
|
|
|
Re: NullPointerException in TextArea
Posted:
Oct 20, 2008 5:01 AM
in response to: cknappe
|
|
|
|
|
Hi, this occurs when setting text from a separate thread. Make sure you always invoke setText and the related methods from the EDT otherwise you might trigger this race condition.
> Hi, > > sometimes I get a NullPointerException when calling setText() on a > TextArea. This is the trace... > > NullPointerException > No detail message > gaia_final-1 > TextArea > getLines > 0xBD26 > gaia_final-1 > TextArea > isScrollableY > 0xBAA6 > gaia_final > Component > isScrollable > 0x1604 > gaia_final > Component > <private> > 0x1568 > gaia_final > Component > paintInternal > 0x1CF4 > gaia_final > Component > paintComponent > 0x137C > gaia_final > Component > paintComponent > 0x1265 > gaia_final-1 > Implementation > paintDirty > 0x7A17 > gaia_final-1 > Implementation > edtLoopImpl > 0x7CD7 > gaia_final-1 > Implementation > <private> > 0x83A7 > net_rim_cldc-1 > Thread > run > 0xB4B7 > > I am using the lib from 14.08.2008 so I don't know if this has been > fixed at all. > > Regards, Christian > [Message sent by forum member 'cknappe' (cknappe)] > > http://forums.java.net/jive/thread.jspa?messageID=310127 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net > For additional commands, e-mail: users-help@lwuit.dev.java.net >
Shai Almog http://lwuit.blogspot.com/
[att1.html]
|
|
|
|
|
|
|
|
Re: NullPointerException in TextArea
Posted:
Oct 20, 2008 8:35 AM
in response to: Shai Almog
|
|
|
OK, but this is done from a Class which implements avax.microediton.location.LocationListener. After locationUpdated is called I show it in my UI. If this is a problem - I will implement this in an other way.
Christian
|
|
|
|
|
|
|
|
Re: NullPointerException in TextArea
Posted:
Oct 21, 2008 12:20 AM
in response to: cknappe
|
|
|
|
|
The location listener will be invoked on the MIDP thread. You will need to use our callSerially (not MIDP's) to transition back to the EDT from the event.
> OK, but this is done from a Class which implements > avax.microediton.location.LocationListener. After locationUpdated > is called I show it in my UI. If this is a problem - I will > implement this in an other way. > > Christian > [Message sent by forum member 'cknappe' (cknappe)] > > http://forums.java.net/jive/thread.jspa?messageID=310413 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net > For additional commands, e-mail: users-help@lwuit.dev.java.net >
Shai Almog http://lwuit.blogspot.com/
[att1.html]
|
|
|
|
|
|
|
|
Re: NullPointerException in TextArea
Posted:
Oct 21, 2008 2:48 AM
in response to: Shai Almog
|
|
|
I did as you said. Works fine in simulator and I think the test on device will also work.
Thanks
> The location listener will be invoked on the MIDP > thread. You will > need to use our callSerially (not MIDP's) to > transition back to the > EDT from the event. > > > OK, but this is done from a Class which implements > > avax.microediton.location.LocationListener. After > locationUpdated > > is called I show it in my UI. If this is a problem > - I will > > implement this in an other way. > > > > Christian > > [Message sent by forum member 'cknappe' (cknappe)] > > > > > http://forums.java.net/jive/thread.jspa?messageID=3104 > 13 > > > > > ------------------------------------------------------ > --------------- > > To unsubscribe, e-mail: > users-unsubscribe@lwuit.dev.java.net > > For additional commands, e-mail: > users-help@lwuit.dev.java.net > > > > Shai Almog > http://lwuit.blogspot.com/ > > [att1.html]
|
|
|
|
|