illegalStateException during the updating of the labelField

package com.GaugeField;

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.GaugeField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;

public class GaugeFieldScreen extends MainScreen {

    GaugeField gField ;
    ButtonField startButton;
    int i = 0;
    boolean isRunning;
    Mythread mythread;
    LabelField labelField ;
    public GaugeFieldScreen() {

        mythread = new Mythread();
        startButton = new ButtonField("Start");
        labelField = new LabelField(i+"");
        startButton.setChangeListener(new FieldChangeListener() {

            public void fieldChanged(Field field, int context) {

                isRunning =true;

                mythread.start();
                add(gField);
                add(labelField);

            }
        });
        gField = new GaugeField("Gausefield", 0,100,0,GaugeField.PERCENT);

        add(startButton);
    }
    class Mythread extends Thread{
        public void run() {
            while (isRunning) {

                i++;
                if(i<=100){
                    gField.setValue(i);
                    labelField.setText(i+"");

                    try {

                        sleep(200);
                    } catch (Exception e) {

                    }

                }

            }
        }

    }

}

I mean illegalState exception labelfield.setLabel (); method in class MyThread

You try to update the user interface of another thread. Keep labelField.setText () next to the next block.

synchronized (Application.getEventLock ())
{

labelField.setText)

}

Tags: BlackBerry Developers

Similar Questions

  • IllegalStateException during the loading of a screen

    Me once again. Don't worry, I've almost finished my app and I'm leaving for a nice weekend well-deserved tomorrow morning early

    anyway. On my first screen I call this code:

       public void fieldChanged(Field field, int context) {
            // TODO Auto-generated method stub
             if(field == ContactButton)
                {
    
                 UiApplication.getUiApplication().pushScreen(new Contact());
                }
             else if (field == DownloadButton)
             {
                    UiApplication.getUiApplication().pushScreen(new DownloadScreen());
    
             }
    
        }
    

    On my Contact button, when pressed, I get IllegalStateException. The download button is displayed and ListField events work fine

    What can be wrong?

    Hannes

    you add title twice comment both this setTitle (title); in your code

    We you add in optimizing resources like this (title) vfm.add;
    and second setTitle (title);

  • Whenever I try to update my iPhone 6 for the ios10 it is said it is impossible and that an error occurred during the installation? I ' have enough free space, so I'm not real why he keeps now.

    Whenever I try to update my iPhone 6 for the ios10 it is said it is impossible and that an error occurred during the installation? I ' have enough free space, so I'm not real why he keeps now.

    Try to update via iTunes.

    See you soon,.

    GB

  • iPhone disconnected during the software update

    My iPhone 5 has been connected to iTunes on my PC and I started a software update.  The phone disconnected during the update due to a bad cable.  Now my phone is locked to the screen update showing the apple logo.   I can't turn off it normally to reboot and iTunes does not recognize the phone when I plug it back on my PC.   Any ideas?

    Use the recovery mode as described here.  You may try to go into recovery mode more than once to succeed.

    If you are unable to update or restore your iPhone, iPad or iPod touch - Apple supports

  • Since the update to El Capitan, during the scrolling of the screen guard snapping back to the top of the screen. How can I stop this?

    Since the update to El Capitan, during the scrolling of the screen guard snapping back to the top of the Web page. How can I stop this?

    Please read this message before doing anything.

    This procedure is a diagnostic test. It is unlikely to solve your problem. Don't be disappointed when you find that nothing has changed after you complete it.

    The test is intended to determine if the problem is caused by a third-party software that loads automatically at startup or logon, by a device, by a police conflict or corruption of system files or some system caches.

    Disconnect all devices wired except those required to test and remove all the expansion cards from secondary market, as appropriate. Start in safe mode and log on to the account of the problem.

    Note: If FileVault is enabled in OS X 10.9 or an earlier version, or if a firmware password is defined, or if the boot volume is a software RAID, you can not do this. Ask for additional instructions.

    Safe mode is much slower to boot and run as normal, with limited graphics performance, and some things work at all, including an audio output and a Wi - Fi connection on some models. The next normal boot can also be a bit slow.

    The login screen is displayed even if you usually connect automatically. You need your password to log on. If you have forgotten the password, you will have to reset it before you begin.

    Test in safe mode. Same problem?

    After testing, restart as usual (not in safe mode) and make sure you always have the problem. View the results of the test.

  • iPad froze during the update and may not exceed

    Has obtained the new ipad and put in place.  Went do the last software update and it froze during the update process.  Blocked at the white screen with the apple logo.  Can not pass it and past 2 hours.  Tried to restore through itunes, but get the error that I need to enter my password which I can't because I'm stuck on the white screen.

    Hey there smbirchler,

    Congratulations on your new iPad! Looks like you were updating the iOS version, the device froze, and now you can't pass the white Apple logo screen, even after you try to restore in iTunes. I know how happy I am when I get a new camera, so we'll work together on that, so you are able to enjoy your iPad mini.

    We will have you try to use the device in Recovery Mode. Take a look at this article for how to do this:

    If you are unable to update or restore your iPhone, iPad or iPod touch

    Thanks for being a part of the communities of Apple Support!

  • An error occurred during the update the firmware. -16

    I tried to update the firmware, after restarting Airport Extreme. But the Airport utility shows that an error occurred during the update the firmware. -16

    I had to restore the factory settings by using Utility button and physics of the airport, but it has not solved the problem.

    I had to restore the factory settings by using Utility button and physics of the airport, but it has not solved the problem.

    I'm not sure what is the problem...

    Your airport is now not working? That is, the reset did not work.

    OR

    It doesn't have to be upgraded after several attempts?

    The airport is connected to the network as usual? You have full internet access through the airport?

    What model is the most convenient airport?

    The real model number could be a help. A1xxx of the base except the newest one... Suffice to say a grand.

    What is the current firmware?

    If it is a very old model, they can sometimes give wrong if it has never been updated.

  • Updated since version 7 or 8 during the installation SETUP message - your computer must be restarted to complete a previous update of Firefox. Do you want to restart now?

    Updated since version 7 or 8 during the installation SETUP message - your computer must be restarted to complete a previous update of Firefox. Do you want to restart now? Options are 'yes or no'. Option 'Yes' restarts my computer & the attempts to Firefox, I get the same message. Reboot several times has no effect. The option 'no' closes the file and nothing happens. Running XP Pro version 2002 SP 3. All normal programs have been updated to the current date (Adobe, Java, etc.).

    Do a cleaning (re) install and delete the folder of the program Firefox (C:\Program Files\Mozilla Firefox\).

    Download a new copy of Firefox and save the file to the desktop.

    Uninstall your current version of Firefox if possible.

    • Do not remove the data of a personal nature when you uninstall the current version or you lose your bookmarks and other data in the profile folder.

    Delete the program folder Firefox before installing newly downloaded copy of the Firefox installer.

    • It is important to remove the Firefox program folder to delete all the files and make sure that there is no problem with the files that were the remains after uninstallation.

    Your bookmarks and other profile data stored in the Firefox profile folder and will not be affected by a relocation, but make sure that you do not select delete data of a personal nature if you uninstall Firefox.

  • Re: Restoration of windows after abrupt during the update

    Hello world

    Last night I was updating my windows on my Toshiba laptop, however, my laptop suddenly shut down during the update process.
    Now, when I start my laptop, I am invited as a system error and I have to put my windows CD to continue. I've never had a CD of windows, and nor have I made a disc of recovery yet, so is it possible possible for me to connect to windows again? I use windows Vista.

    Any suggestions would be grateful.

    Thanks in advance

    You can enter advanced with F8 at startup startup options?
    You can get Vista in safe mode?
    Repair my computer option is available there?

    Try to use this option and you will enter the system recovery options. One of the options it is start repair or system restore.
    Try to fix the system or roll back the OS to an earlier time using System Restore.

  • Satellite Pro T2150-CDT - nime BIOS file during the update

    Have an old TOSHIBA T2150 CDT PA-1186U. BIOS version computer messages during the boot process is ' BIOS Toshiba video v2.0» When trying to update BIOS upgrade bios excessive wonder entry "name of BIOS file. I have registration ' "B2150CDT."» EXE' but bios excessive says "cannot find the BIOS file.

    What name of BIOS file I have to input durin processing BIOS update program?

    Hi flâneur.

    To be honest I don t understand what you mean exactly but maybe that information on the page of the Toshiba BIOS update can help you a bit:
    http://www.toshiba-tro.de/biosinfo/

  • What can I do about 48 error during the update of the iphone 4S?

    What can I do about 48 error during the update of the iphone 4S?

    Hello! Try the procedure described in section of the Apple Support below:

    Solve the iOS update and restore error in iTunes - Apple Support

  • Satellite A300 does not start after extinction during the BIOS update

    Hello

    I tried to update the BIOS after reading a TOSHIBA TEMPRO alert, after some time, apparently not run so I ran a second time, then both ask of BIOS appeared in the taskbar only and it froze while I did not start the upgrade or anything like that I had to the power off.

    I tried to restart, but now, it just on the screen stays black (the monitor is not powered, as if the system was not running), all LEDS are powered with flashing 'drive access', the led on the DVD Player keeps flashing making a noise every 3 seconds or more.

    I read on the forum that there may be no solution but to take it to an authorized service provider but I'm willing to take any possible solution before you do.

    Thanks for any advice.

    Alex.

    Hi, mate

    Unfortunately, you need to be reflash the Bios as something that went wrong during the update. You should contact the Asp and ask them to reflash. There is no other way to get your laptop to work.

    Good luck!

  • My MacBook froze during the installation of the update at El Capitan and now I am unable to connect to any except the screen of the guest user. There was a message of panic, and somewhere in there, he said no set of OS. I tried to start without danger, it

    My MacBook froze during the installation of the update at El Capitan and now I am unable to connect to any except the screen of the guest user. There was a message of panic, and somewhere in there, he said no set of OS. I tried to start without danger, it does not work either.

    This general situation may be similar to what is mentioned in this sequel to thread of the CSA

    and if the remedy is to use instructions; detailed and I hope they are correct...

    Re: Restart fails after installation of El Capitan help!

    Or you can try and see on the repair of the system and then if your disk utility can

    See the Macintosh HD, as a boot volume, you could restart from OS X Recovery to

    the Mac system, to see if this solves the problem. There may be more than one cause.

    You could try and boot into OS X Recovery, utilities out there, and other options are available.

    • OS X: on OS X Recovery - Apple Support

    This example uses a special partition on the hard drive of recovery which is not in the

    same disc that the Mac OS X section; However if your hard drive is missing, these other

    items may also be at risk. You must have and maintain backups of your duplicate content

    on the external storage drives closed; In addition, a Time Machine backup helps to restore.

    • Apple OS X and Time Machine tips:

    http://pondini.org/OSX/home.html

    • Tips for OS X - using HD recovery:

    http://pondini.org/OSX/RecoveryHD.html

    {Using the utility disc and other tools can be done from the boot OS X Recovery volume

    Beware of the fact these tools can also delete or reformat your content; wiping.}

    Don't know what to say; you could see visiting an Apple store with genius if

    There is an official store. Usually for best time planning you would contact them for an appointment.

    Or if there is no official retail Apple Store with genius, the following suggestion would be to contact

    a service provider authorized Apple, an independent specialist who is qualified in the repair of Apple.

    In any case...

    Good luck & happy computing!

  • Equium A60 crashed during the update of the Bios

    Hello, can someone tell me if this can be repaired. IHAVE an A60 Equium that crashed during the update of the BIOS, now he died nothing lights up.
    Thanks in advance

    I presume that the BIOS chip is damaged. In this case, you can do anything to make it work again. Just approved can help.

    The problem is that the repair can be quite expensive. Check it out. If selling Yes the laptop on eBay and... you know what I mean. :(

  • Should I keep plugging my iphone to the computer during the update download process? especially the download will take too long because it is more than 2 GB and my internet speed is not fast, I can unplug my iphone until the full download?

    I am a new user of Iphone, I must he keep plugging my Iphone to the computer during the update download process? especially the download will take too long because it is more than 2 GB and my internet speed is not fast, I can unplug my Iphone until the full download?

    Without doubt, but why not just make the day downloading overnight?

Maybe you are looking for