Threads... how to stop / change to other..

I have two classes; UiControl an UI. In UiControl I handle which form to show etc. and UI is showing them and there are some commandListeners also.
I have methods show() and showInfo in class UI.
class UI implements Runnable
public void show(Displayable dp)
     display.setCurrent(dp);
public void showInfo(Displayable dp)
     this.setDisplayable(dp);
     Thread tr = new Thread();
     tr.start();
public void run()
        display.setCurrent(displayable);   
}Here (in class UI)I have these methods I use to show forms. ShowInfo is used because sometimes "splashscreen-typeOfInfo" have to be transmitted to user right after somebutton is pressed and show() method waits that tasks commandLiesteners started in other parts of application are finished and only after that then updates screen, which is too late when come to think of usability.
The question / problem is that now I use show()-method once, then I repeatedly use showInfo() few times, and after that once again show(). After that showInfo() gets called (I can verify that when debugging), but nothing comes to screen...
Any ideas how to fix this?
Thanks in advace.
P_p

Sorry.. copy/paste error from code.
Thread tr = new Thread();should be:
Thread tr = new Thread(this);P_p

Similar Messages

  • We had one family apple id. I want to keep all devices on the same apple id for itunes but separate ones for everything else.  How do I change the others now.  We have 3 iphones and an ipad.

    We had one family apple id.  I want to keep all devices on the same apple id for itunes but separate for everything else on the cloud. How can I change the other apple ids now? We have 3 iphones and an ipad.

    Hi, thank you for this post.  I hope you might be able to help me too? 
    I am relatively new to apple (have an iPad) and having been a PC user for years I was pleasantly surprised with the apple experience and am now trying to work out the best set up for me, my husband and young son as I am buying them both of them apple products this Christmas.  New Mac laptop/ ipad for hubby and then an ipod touch for my son oh and a new mac laptop for me. We are also thinking of moving from Blackberries to iPhones. Yes we seem to be hooked! but i am unsure about the home family set up and how to replace my PC network that I run off an 8TB server.
    In reading the forums I keep seeing people talk about problems they have with two apple IDs and trying to merge them. I have also heard about a family ID allowing us to share apps legally.  I am really nervous of setting us up wrong and then having problems later and hence i am now looking for some advice on how to share as much as we can legally but also make usage practical and not invading each others privacy. thoughts so far:
    Music - I think we are happy to share the same music and access using one ID (we currently don't buy much music from apple but have lots of CDs we share).
    Photos - It would be nice to share photos - as long as my son or husband cannot accidentally delete photos of mine (which is my biggest concern). I currently load all camera photos onto my 8TB storage box as the network owner and my husband has full access to copy any photo to his laptop but can never delete the original copies by accident.
    Apps - If possible i would like us to share these but they are cheap enough these days to separate if really needed. Would be good to share licence for pages etc though
    cloud, contacts, facetime, email -  this is what is making me consider separate IDs or learning how to have multiple users in one apple ID - I do not want to have to share synced contacts with my husband. I have near 300 contacts now through work etc and he will not want them plus i will not want his or him being able to delete mine by mistake. and then for email and facetime, well I want to give him his privacy so I do not receive his messages etc. especially now that we are considering switching to iPhones
    Then last but not least, i don't know the best solution for my son. he is only 7 years old so even though I don't want to pay for things again I don't want him being able to download "just any" app from the purchased icon in Appstore. Also, is there a child friendly setting to prevent him from viewing inappropriate content on the internet?
    Appreciate I have asked a lot of questions here but I am looking for any genuine advice out there. Thank you or other potential advisers in advance.

  • Thread: how to stop it?

    I'm new with thread and I don't understand some things about that.
    For example: when I create a Class that extends Thread class I must override the method run(), right? After when I call the method start() from the Class the thread runs in a never-ending cycle? How can I stop it?
    The example code:
    public class MyClass extends Thread {
        private int value;
        public MyClass() {
            value = 0;
        public void run() {
            value++;
    }Does the class continue to do the addition until it will throw an exception (when the max value of int type is reached)?
    Message was edited by:
    Lukyan

    Try to run it and see, no?Quoting myself ... I did not mean to be facetious. I really thought that actually running the code would be the clearest way of "seeing" the results. Better answers both before and after mine have provoked me to add the following:
    It is very common to code the actual guts of your "Thread" similar to this:
    private boolean run = true;
    public void run() {
      try {
        while (run) {
          doMethodA();
          doMethodB();
      } catch(InterruptedException ie) {
        doMethodC(); // or print the stack trace or something
    private void doMethodA() {
    private void doMethodB() {
      if ( "bad".equals(condition) )
        run = false;
    }

  • How to stop changes being synced from ipad mobile back to lightroom?

    Until now, noone in my family has been able to look at any of my hundreds of thousands of photos as they are all locked up in lightroom except the small subset I upload to facebook or similar.
    Now with lightroom mobile, they can see all my hundreds of collections.
    And change them.
    Seriously, how do I stop my 3 year old and wife from destroying my man hours of editing?
    How do I make the sync to ipad one way, or make them read only on the ipad?
    Without this, sadly, light room mobile is useless.
    Any solutions appreciated.

    I am so sad I could cry.  Luckily I only installed the trial version of 5.5 so I can go back to my lightroom 4, and none will be able to see my millions of family photos again.
    I will remove lightroom mobile immediately from my wifes 64GB ipad (i don't have or want one), as my 3 year old uses it every day, which would mean ll my photos getting destroyed in minutes.
    In so many years, it is astounding that I dont have a way for people to be able to see my 1 TB of photos locked up in lightroom, unless I tediously export them to disk, and then copy them over by hand to external devices each time I produce new photos, which is too much work.
    This is such a huge missed opportunity for adobe to provide a product which lets friends and family view their hard work at home.
    Personally, I would never edit photos on an ipad, I have 2 calibrated 30" IPS monitors, a workstation with 32GB ram and twin SSDs for lightroom work (I do weddings also).  But I do want for family to be able to look at them and use them, without having to give them my workstation.

  • How to stop changing stroke weights when changing the size of an object in CS5 on Windows 7?

    I'm not sure what I did to make this happen or how to change it back, but for some reason when I change the size of an object/line it changes the stroke weight as well. (For example, if I drew an ellipse with stroke weight 2 pt, and then increased the size the stroke weight would be 2.856 pt or some such number instead of 2 pt.) Does anyone know how to change this back?
    Thanks!

    Take a look at the Scale Strokes and effects preference either in the general programme preferences or in the flyout menu of the Transform palette.

  • Javafx Multi Threading - How to stop a thread

    Hi,
    I'm working on a Javafx and Java based chat client. To avoid GUI freezing I have put all "business logic" calls to Java using the Runnable feature. Everyting works ok, but when for example disconnecting the chat client I would also like to stop this specifc thread, avoid building up unused threads. I have tried using .stop() but it looks like its being ignored.
    Here my code:
    main.fx:
    progressIndicator.visible = true;
            var listener = FXListener_interface_connection {
                        override function callback(errorCode, errorMessage): Void {
                            //do something
                            if (errorCode != 200) {
                                setIcn(errorMessage);
                            } else {
                                progressIndicator.visible = false;
                                imageView9.visible = true;
                                openMessageListener();
                                rosterListener();
                                var ooo = ScaleTransition {
                                            duration: 0.2s
                                            node: imageView9
                                            byX: 0.6 byY: 0.6
                                            repeatCount: 8 autoReverse: true
                                ooo.play();
            var connect = FXListener_connection {
                        listener: listener
                connect.start();listener_connection.fx:
    public class FXListener_connection extends JavaTaskBase {
        public var listener: FXListener_interface_connection;
        protected override function create() : RunnableFuture {
            new Java_callback_connection(listener);
    }connection_interface.java
    public interface FXListener_interface_connection {
        public void callback(Integer errorCode, String errorMessage);
    }connection_callback.java
    public class Java_callback_connection implements RunnableFuture {
        private static FXListener_interface_connection listener_interface_connection;
        public Java_callback_connection(FXListener_interface_connection listener_interface_connection) {
            this.listener_interface_connection = listener_interface_connection;
        @Override
        public void run() throws Exception {
            //call function xmpp_connect()
            static_variables.xmpp.xmpp_connect();
        public static void connection(final Integer errorCode, final String errorMessage) {
            Entry.deferAction(new Runnable() {
                @Override
                public void run() {
                    listener_interface_connection.callback(errorCode, errorMessage);
    }

    jdevel doesn't let me debug;
    public class ProgressBarModel extends BoundedRangeModel {
    BooleanValueWrapper stopFlag = new BooleanValueWrapper(false);
    BooleanValueWrapper stopFlag2 = new BooleanValueWrapper(false);
    IntValueWrapper value = new IntValueWrapper(0);
    Thread newProgress = null;
    Thread newProcessFile = null;
    public void start(ActionEvent e) {
    value.setValue(0);
    stopFlag.setValue(false);
    ProgressSimulator progressSimulator = new ProgressSimulator();
    newProgress = new Thread(progressSumulator);
    newProgress.start();
    ProcessFileThreadMe processFileThreadMe = new ProcessFileThreadMe();
    newProcessFile = new Thread(processFileThreadMe);
    newProcessFile.start();
    class ProgressUpdater implements Runnable
    public void run(){
    try
    System.out.println(" ProgressUpdater is running");
    //stop fag is true if it is set to true or if value is equals or greater
    //than maximum
    try { 
    stopFlag.setValue(stopFlag.getValue() == true? true : (value.getValue() < maximum? false:true));
    //run in loop until stop condition is met. Make sure system doesn't
    //fail if values are initially set to the same value
    while (!stopFlag.getValue() && value.getValue() != maximum) {
    newProgress.interrupt();
    newProgress = null;
    } catch(Exception e) {
    stopFlag.setValue(true);
    stopFlag2.setValue(true);
    class ProcessFileThreadMe implements Runnable
    public void run(){
    System.out.println(" ProcessFileThreadMe is running");
    try
    if(stopFlag2.getValue() == true) {
    // interrupt this thread
    // set it to null
    return;
    bean.persisit(value, stopFlag);
    newProcessFile.interrupt();
    newProcessFile = null;
    catch (Exception exc)
    stopFlag.setValue(true);
    stopFlag2.setValue(true);
    exc.printStackTrace();
    In the bean the v alue is incremented
    Edited by: user597294 on Jul 21, 2011 6:33 AM

  • I DON'T KNOW MY SECURITY QUESTIONS BECAUSE MY DAD MADE THIS ACCOUNT A FEW YEARS AGO! HOW DO YOU CHANGE THEM!?

    I DON'T KNOW MY SECURITY QUESTIONS BECAUSE MY DAD MADE THIS ACCOUNT A FEW YEARS AGO! HOW DO YOU CHANGE THEM!?

    So how do I change it

  • When I nudge clips in Premiere CC they will "run over" other clips, how do I change this behavior so the clip will stop when it hits another clip?

    When I nudge clips in Premiere CC they will "run over" other clips, how do I change this behavior so the clip will stop when it hits another clip?

    Not sure what behavior you are exactly looking for, to move the clip and have it stop and the next clip in the direction of travel, drag the clip with the mouse with Snapping turned on in the timeline.
    MtD

  • How to stop showing the pop-up window to change password

    Hi,
    How to stop showing the pop-up windows of changing password if the password is expired in dba_users table. This is related to form6.
    Pls advice.
    Thanks
    Raj

    Raj,
    Please do not start a new thread with the same problem. If you still need help, respond to your former thread, and we will still try to help you. But you haven't provided an answer to why you can't trap the error.
    Re: Trapping of error ora-28001, user expired in daa_users table

  • How to stop main thread ?

    Hi,
    Inside my java class, after I launch a GUI, I want to stop this main thread. After user make some choice and close GUI window, then, I want to go back to main thread. I use wait() method inside my class to stop main thread , but it does not work and it give me "IllegalMonitorStateException" error. I met same thing, when user close the GUI window and call method notifyAll(). How to stop main thread for a while and how to go back?? Thanks
    Gary

    Hi,
    you can create a boolean, and create a while loop, with a Thread.sleep(time); when you want to continue, you just have to change the state of your boolean. So you don't hava to exit the main. And you can't restart a run() in a thread. You can run it only once, so try to keep in your run() with an appropriate loop.
    Hope it helps.
    S�bastien

  • HT2731 How can I change my store to US, now that I am in the US? A link in a previous thread says not accessible as the profile still shows different country..

    How can I change my store to US, now that I am in the US? A link in a previous thread says not accessible as the profile still shows different country..

    As long as you have a form of payment (credit or debit card) with a USA source, and with a billing address in the USA, then you just need to change your payment information on your account to that, change your country in the store settings, and you will then be able to shop in the USA store.
    Your AppleID will work in any country's store, as long as your payment source and billing addres are also specific to that country (and you are in that country as well, as there may be IP filters in place to stop use outside of the country).

  • How to 'STOP' a running java thread in J2ME?

    Dear All,
    How to 'STOP' a running java thread in J2ME?
    In the middleware viewpoint, for some reasons we have to stopped/destroyed the running threads (we have no information how these applications designed).
    But in J2ME, Thread.destroy() is not implemented. Are there other approaches to solve this problem?
    Thanks in advance!
    Jason

    Hi jason,
    Actually there are no methods like stop() and interrupt() to stop the threads in J2ME which is present in normally J2SE Environment.
    But the interrupt method is introduced in Version 1.1 of the CLDC.
    So, we can handle the thread in two ways.
    a) If it is of single thread, then we can use a boolean variable in the run method to hadle it. so when the particular boolean value is changed , it will come out of the thread.
    for eg:
    public class exampleThread implements Runnable
    public boolean exit = false;
    public void run()
    while(!exit)
    #perform task(coding whatever u needed)
    public void exit()
    exit = true;
    b) If it is of many threads then we can handle using the instance of the current thread using currentThread() method
    for eg:
    public class exampleThread implements Runnable
    public Thread latest = null;
    public Thread restart()
    latest = new Thread(this);
    latest.start();
    public void run()
    Thread thisThread = Thread.currentThread();
    while( latest == thisThread )
    #perform some tasks(coding part);
    public voi d stopAll()
    latest = null;
    while ( latest == thisThread )
    performOperation1();
    if( latest != thisThread )
    break;
    performOperation2();
    Regards,
    Prathesh Santh.

  • HT201303 For added security how do you change the iphone security number to stop hacking

    For added security how do you change the iphone security number to stop hacking

    Forgotten security questions - https://discussions.apple.com/message/18402551
    More involved forgotten question issues - https://discussions.apple.com/thread/3961813

  • New Socket takes too long / how to stop a Thread ?

    Hello to everyone,
    I have a problem that I have been hunting this ol' Sun website all day for a suitable answer, and have found people who have asked this same question and not gotten answers. Finally, with but a shred of hope left, I post...
    My really short version:
    A call to the Socket(InetAddress,int) constructor can take a very long time before it times out. How to limit the wait?
    My really detailed version:
    I have a GUI for which the user enters comm parameters, then the program does some I/O while the user waits (but there is a Cancel button for the Impatient), then the results are displayed. Here is quick pseudocode (which, by the way, worked great before there were Sockets in this program -- only serial ports):
    Main (GUI) thread:
         --> reset the stop request flag
         --> calls workerThread.start(), then brings up a Cancel dialog with a Cancel button (thus going to sleep)
         --> (awake by dialog closing -- dialog may have been closed by workerThread or by user)
         --> set stop request flag that worker thread checks (in case he's still alive)
         --> call workerThread.interrupt() (in case he's alive but asleep for some reason (???))
         --> call workerThread.join() to wait for worker thread to be dead (nothing to wait for if he's dead already)
         --> display worker thread's result data or "Cancelled..." information, whichever worker thread has set
    Worker thread:
         --> yield (to give main thread a chance to get the Cancel Dialog showing)
         --> do job, checking (every few code lines) that stop request flag is not set
         --> if stop request, stop and set cancelled flag for Main thread to handle
         --> if finish with no stop request, set result data for Main thread to handle
         --> take down Cancel Dialog (does nothing if not still up, takes down and wakes main thread if still up)
    THE PROBLEM: Worker thread's job involves doing IO, and it may need to instantiate a new Socket. If it is attempting to instantiate Socket with bad arguments, it can get stuck... The port int is hardcoded by the program, but the IPAddress must be typed by user.
    If the arguments to Socket(InetAddress, int) constructor contain a valid-but-not-in-use IP address, the worker thread will get stuck in the Socket constructor for a LONG time (I observed 1m:38s). There is nothing the Main thread can do to stop this wait?
    EVEN WORSE: If the user clicks the Cancel Button during this time, the dialog goes away soon/immediately, but then the GUI appears to be hanging (single-threaded look) until the long wait is over (after which the "Cancelled..." info is displayed).
    MY QUESTION: Is there nothing the Main thread can do to stop this wait?
    Your answers will be sincerely appreciated. Despite my hopeless attitude (see above), the folks at this forum really have yet to let me down ...
    /Mel

    http://developer.java.sun.com/developer/technicalArticles/Networking/timeouts/

  • HT1311 I know this is a basic question, however, how do i change my pass word on itunes to stop my kids from automatically buying tunes from the I store... as my card details are already saved they just log in with their ipods and download via my account

    I know this is a basic question, however, how do i change my pass word on itunes to stop my kids from automatically buying tunes from the I store... as my card details are already saved they just log in with their ipods and download via my account

    http://support.apple.com/kb/HE36
    Regards.

Maybe you are looking for

  • Simple help with DOM parsing - urgent

    hi, i'm new to xml parsing and have a simple (i think) question. i have the following xml <record> <header> <id>1</id> </header> </record> <record> <header> <id>1</id> </header> </record> i'm trying to parse first the records then from a record parse

  • Photostudio/Elements Resolution Issue

    I have been scanning photos using Photostudio 5.5 and enhancing them using Elements 5 with a view to archiving them on a DVD and also creating slideshows. When I scan the images I set the resolution at 500dpi, however when I open them in Elements and

  • Had to reset router, pass did not work, how to make secure again?

    Password would not work, had to reset to factor. How do I make a new password and secure it again? WRT5462

  • Webkitwebprocess.exe has stopped working

    not sure how to stop my safari from crashing every once in a while; message shows as webkitwebprocess.exe has stopped working. any help, most welcome! :-)

  • Anyone using a Labview solution to perform SDLC communications?

    Need to take data from a variety of test equipment that are putting out a simplified form of the IBM Synchronous Data Link Control (SDLC) message structure. The device will basically be in "broadcast" mode with address and control data absent from th