BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-11-2005, 11:40 PM   #1 (permalink)
New Member
 
Join Date: Jun 2005
Model: 8250
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default NullPointerException in a RichTextField - Help!

Please Login to Remove!

Hi all,

I'm writing a simple multithreaded application for the BB 7290 (in simulator) with the latest RIM SDK and am experiencing an exception. Any ideas would be appreciated!

Here are the details:

1. My program has 3 background threads that perform processing.
2. My program has the usual main UI thread running a mainscreen object.
3. When one of my background threads wants to update a RichTextField in the mainscreen object, it uses the usual
synchronized(Application.getEventLock())
{ ... }
and inside the bracers calls a method of my mainscreen object to do so.
4. The method in the mainscreen object updates my richtext field using the following command:
m_myRichTextField.setText("Carey's value...");
5. None of the other background threads are accessing the
m_richTextField, nor is the mainscreen accesing the field except during construction or when called as discussed in step 3 above...
6. During a re-paint of the recently-changed rich-text field (described above), a NullPointerException is thrown. Here's the top of the stack:

RichTextField.getDisplayLineCount() Line 342
RichTextField.paint (Graphics) Line 607
Field.paintSelf(Graphics,boolean,int,int) Line 2857
Manager.paintChild(Graphics, Field) Line 1378
VerticalFieldManager.subpaint(Graphics) Line 364
...
MyApp.main(String[]) Line 19

7. This appears to be a synchronization issue, since its not consistently reproducable. It takes several attempts of starting/stopping the application (or switching between applications) to get it to throw. The issue only appears to happen after I update other fields in my mainscreen object (such as a list of items in the same vertical field manager). However, when updating this list of items, no changes are made whatsoever to the rich text field that's causing the exception.


Any help would be appreciated!

Thanks,

Carey
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

IBM 1337765 Lift-Off CorrectionTape - Genuine OEM for IBM Wheelwriter
$9.99
IBM 1337765 Lift-Off CorrectionTape - Genuine OEM for IBM Wheelwriter  pictureOEM IBM SurePOS 700 4800-743/783 250W Power Supply DPS-250AB-45A 46N1999 46N1998
$31.75
OEM IBM SurePOS 700 4800-743/783 250W Power Supply DPS-250AB-45A 46N1999 46N1998 pictureOEM Genuine IBM POS Display with POLE PN - 41K6814
$24.99
OEM Genuine IBM POS Display with POLE PN - 41K6814 pictureIBM #4 Y Cable Genuine OEM Long POS Cash Register 4A to 4B 10N1002 J96367
$24.99
IBM #4 Y Cable Genuine OEM Long POS Cash Register 4A to 4B 10N1002 J96367 pictureLOT of 12 GENUINE OEM IBM EASYSTRIKE LIFT OFF TAPE CASSETTES #1337765
$40.0
LOT of 12 GENUINE OEM IBM EASYSTRIKE LIFT OFF TAPE CASSETTES #1337765  picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.