BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-27-2008, 10:35 AM   #1 (permalink)
New Member
 
digitalhuman's Avatar
 
Join Date: Jul 2007
Location: Netherlands
Model: 8110
OS: WinXP
PIN: 254E354B
Carrier: KPN
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Update RichTextField when application is running

Please Login to Remove!

He there,

Im very new to JDE so i hope you can help me out.

I have a class which reads data from an URL and returns string:

Like this:
Code:
textReader r = new textReader();
Dialog.alert(r.readData());
Now, wheh i press Start in mij ContextMenu i would like it to display the
r.readData() on the mainscreen in a RichTextField. But when i try to do
that i get an error like:

blocking on event dispatch thread

So the action below isn't working:

Code:
    private MenuItem _mGetData = new MenuItem("Ophalen",1,10){
        public void run()
        {
            rTextFiel.setText(r.readData());
        }
    };
Offline  
Old 10-27-2008, 11:37 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorround your code with invokelater or synchronize on the eventlog, see the developers guide for details
__________________
java developer, Devinto, hamburg/germany
Offline  




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