Thread's run() doesn't get called ?

Hi,
I have a subclass of Thread and I create its instance and call its start() method. Documenttion on Sun's site says that start tells JVM to call run() method....BUT the problem is the run() method is not called as soon as I call start() Why ?
For Example
void foo()
(new MyThread()).start();
System.out.Println("RUN NOT CALLED YET");
class MyThread extends thread {
public void run()
System.out.Println("RUN CALLED");
So here "RUN NOT CALLED YET" is printed before "RUN CALLED" gets printed. Why ? Any clue ?

Hi,
That is how threading work. A new thread is created and scheduled for execution, but it's not certain that it will start execution before the main threads println statement is executed. (Remember that the threads will (logically) be executing in parallell)
/Kaj

Similar Messages

  • Validator doesn't get called if textField is null

    Has anybody seen this? Is there a workaround?
    Thanks!

    Hi,
    The validator will not be invoked for fields in which no value has been entered.
    If the custom validator checks if a value has been entered or not then we could use the required property instead.
    In case the the custom validator does some other validation then it does not make sense to call the validator if there is no value in the field. The practice was to check if the value is null before proceeding to the validation. The same can be achieved by using the required property. As the required property would enfore entering of a value, the custom validator would have a value to validate.
    Hope that helps
    Cheers
    Giri

  • H:dataTable getter called during APPLY_REQUES_VALUES stage

    Hello,
    I'm having some trouble with localization. I need to set labels of components in an h:dataTable with localized strings.
    To change the locale I have an immediate commandLink that calls an action containing setLocale().
    Now here's the problem. When I change the locale the h:dataTable calls my value bound getter during the APPLY_REQUEST_VALUES stage! This occurs before the setLocale() call.
    Log:
    17:16:55 [INFO ] PhaseTracker BEFORE RESTORE_VIEW 1
    17:16:55 [INFO ] PhaseTracker AFTER RESTORE_VIEW 1
    17:16:55 [INFO ] PhaseTracker BEFORE APPLY_REQUEST_VALUES 2
    17:16:55 [DEBUG] LocaleStrings loading from table divisionstrings...
    17:16:55 [DEBUG] LocaleStrings current locale: fr
    17:16:55 [DEBUG] LocaleStrings setting locale to fr
    17:16:55 [INFO ] PhaseTracker AFTER APPLY_REQUEST_VALUES 2
    17:16:55 [INFO ] PhaseTracker BEFORE RENDER_RESPONSE 6
    17:16:56 [INFO ] PhaseTracker AFTER RENDER_RESPONSE 6
    So the result is that the localized strings on the elements in the h:dataTable are set using the incorrect previous locale.
    Normally when I do not use h:dataTable, my value bound getter doesn't get called until the RENDER_RESPONSE phase. In that case everything works fine.
    Anyone able to shed any light on how I can fix this? Thanks.

    I dug through the code a bit...
    During the APPLY_REQUEST_VALUES phase components are asked to processDecodes().
    Now this is expected however for UIData (the ancestor of HtmlDataTable) it needs to set a row index which results in the data model being retrieved and all the value bindings being called.
    Here's a partial stack trace:
    at javax.faces.component.UIData.getValue(UIData.java:527)
    at javax.faces.component.UIData.getDataModel(UIData.java:856)
    at javax.faces.component.UIData.setRowIndex(UIData.java:379)
    at javax.faces.component.UIData.iterate(UIData.java:898)
    at javax.faces.component.UIData.processDecodes(UIData.java:737)
    Hmm... so looks like things will be called twice. Once in the APPLY_REQUEST_VALUES phase and again in the RENDER_RESPONSE phase.

  • JComboBox  itemStateChanged gets called twice.

    Hi i have a JComboBox whoes itemStateChanged gets called twice. I have taken a look at other post concerning this topic and non have worked for me . I will greatly appreciate it if someone can help me
    here is the code !!!!!!!!!!
    jComboBox3.addItemListener(new ItemListener(){
    public void itemStateChanged(ItemEvent e) {
    if(e.getStateChange() == e.SELECTED){
    jComboBox3_dosomething(e);
    thanks in advance

    Maybe this thread will answer why it gets called twice:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=257226

  • Shutdown hook not getting called when running tomcat as a service

    I have a shutdown hook as part of a lifecycle <Listener> tomcat6 class, which gets created and registered in the class's constructor (class is referenced in the server.xml). The hook gets called during shutdown when tomcat has been started from a shell, but not when tomcat has been installed as a service. The -Xrs flag doesn't make a difference either way. I am running java 6u12 server VM (haven't tried client) and prior versions. Does anyone have any ideas? This has been tested by starting/stopping from the Control Panel, and also with 'tomcat6 //TS/ServiceName' (i.e. in test mode)
    One possibility is that tomcat internally calls Runtime.halt(), but the shutdown process appears to be normal and the same with either scenario. The other possibility is that the JVM has an issue. The tomcat user groups don't have anything to offer.
    Thoughts?
    tia

    sanokistoka wrote:
    jschell wrote:
    sanokistoka wrote:
    Let me ask the last question in a better way: Does anyone have any GOOD ideas?Get back to us when you have found your good solution.Stop wasting bandwidth. I didn't post here to be a smart ars like you and pretend that I have a solution to a rare problem... FYI - the workaround is to use the tomcat lifecycle events (AFTER_STOP_EVENT) to achieve the same - why do you think I mentioned it's a tomcat listener in the first place? Feel free to educate me.
    So you are claiming that Runtime.getRuntime().addShutdownHook() that you posted in the above is not part of the java API?
    Or perhaps that everything that is added via addShutdownHook() runs?
    Surely you are not claiming that it isn't calling addShutdownHook() in the first place?
    Get a life and a job.I have both but thanks for the concern.
    sanokistoka wrote:
    swamyv wrote:
    There are free tools available to debug windows. I think gdb is one of them. If you search you can find some good tools.
    If you find any good tools that you like share it with us.
    Yes I will try gdb (have cygwin) and see where this takes us - not sure if the JVM or tomcat6.exe have the symbols to get a meaningful stack trace. As luck would have it, [https://issues.apache.org/bugzilla/show_bug.cgi?id=10565|https://issues.apache.org/bugzilla/show_bug.cgi?id=10565] claims that "shutdown hooks are not supported in a container environment" although there is no such restriction in the servlet spec, which would make this a tomcat issue (it does sound like that tomcat6.exe wrapper is somehow involved). Unfortunately, tomcat does NOT issue the AFTER_STOP_EVENT if killed before it has completed its start-up (it appears its own shutdown hook, which sends the event, is not registered until it has fully come up); thus the need for a shutdown hook (at least, up until it's fully up). A shutdown hook is still required in my case for clean-up after tomcat is completely out of the picture. It sounds like the proper architecture here is to really embed tomcat in an application, and create a shutdown hook at the outer level.
    Educate me some more. The above description certainly seems like you are suggesting that both of the following are true.
    1. It is not a bug in the VM.
    2. The problem, for your implementation, is in how the wrapper terminates the windows service.
    Perhaps what is actually happening it that addShutdownHook() is never being called at all? Thus of course any processing of the thread associated with that would never, ever run.
    And that happens because you are banging on the stop service so fast that it doesn't actually have time to spin up?

  • HT5554 I have the iPhone 5 and I keep getting a no sim card message. I have had my phone for over a year now so I know I have a sim card. How can I fix this because it doesn't let me get calls now.

    I have the iPhone 5 and I keep getting a no sim card message. I have had my phone for over a year now so I know I have a sim card. How can I fix this because it doesn't let me get calls now.

    Try resetting the phone. Hold the home and power lock button until the Apple logo appears.If that does not work, turn the phone off and take the SIM out and then put it back in.
    If that still does not work, you may have a defective SIM, in which case you will need a new one from your carrier.

  • I keep getting calls, so I added that number to my list of calls to block.  It doesn't ring anymore, but I keep getting notification messages that say "Call back".  Why do I receive this when the call should be blocked?

    I keep getting calls from (removed), so I added that number to my list of calls to block.  It doesn't ring anymore, but I keep getting notification messages that say "Call back (removed)".  Why do I receive this when the call should be blocked?
    Private info removed as required by the Verizon Wireless Terms of Service
    Message was edited by: Admin Moderator

    Okay, you are correct the call is not supposed to ring in. Have you done any troubleshooting on the phone? First off, try power cycling the phone. Turn the phone off, then back on again. If that does not work, then try a reset. Hold the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will reboot. See if that changes things. Is the caller using the exact number that you blocked, or is it possible they are using another number, or have restricted the Caller ID?

  • How many  threads are running?

    here's the code... i am trying to understand, at each point, how many threads are running:
    I understand that one thread belongs to the caller of the start()
    & at the same time there is another thread belonging to the instances of each thread (thread1, thread2, thread 3 etc.)
    1public class ThreadTester {
    2   public static void main( String args[] )
    3   {
    4      PrintThread thread1, thread2, thread3, thread4;
    5
    6      thread1 = new PrintThread( "thread1" );
    7      thread2 = new PrintThread( "thread2" );
    8      thread3 = new PrintThread( "thread3" );
    9      thread4 = new PrintThread( "thread4" );
    10
    11      System.err.println( "\nStarting threads" );
    12
    13      thread1.start();
    14      thread2.start();
    15      thread3.start();
    16      thread4.start();
    17
    18      System.err.println( "Threads started\n" );
    19   }
    }can you tell me if i am counting the number of threads in existance correctly...
    LINE#.....CALLER...START...TOTAL THREADS
    13..............1.........1.......2
    14..............1+1......1+1.....4
    15..............2+1......2+1.....6
    16..............3+1......3+1.....8
    so by the time line 16 executes i have a total of 8 threads,
    4 threads belonging to each caller plus
    4 threads created by start()
    or is it
    LINE#.....CALLER...START...TOTAL THREADS
    13..............1........1........2
    14..............1........1+1.....3
    15..............1........2+1.....4
    16..............1........3+1.....5
    after line 16 executes does the caller thread die, thus leaving only a total of 4 threads?
    there is only one thread belonging to the caller at line 13(plus the thread it creates).
    at the start of line 14, the previous callers thread is dead & now a new thread is created that belongs to the caller on line 14... etc.

    well, i realize at the end there would be 4 threads but im trying to get my head around this explanation in the book:
    "A program launches a threads executioin by calling the threads start method, which in turn call the run method. After start launches the thread, start returns to tis caller immediately. The caller then executes concurrently with the lauched thread." there fore if i have 2 concurrent processes, are there 2 threads running????
    now having said the above, my question was:
    for each line,
    how many threads are in existance at
    line13
    line14
    line15
    line16
    thanks.

  • ToString() method in my User defined Exception...How is it getting called ?

    CustomException.java
    public class CustomException extends Exception
         private int age;
         public CustomException(int age)
         this.age = age;
         public String toString()
         return "this is my exception";
    ExceptionTest.java
    public class ExceptionTest
         static int age=-1;
         public static void main(String args[]) throws Exception
              if(age<0)
              throw new CustomException(age);
    After executing ExceptionTest.java , the result is
    Exception in thread "main" this is my exception at ExceptionTest.main(ExceptionTest.java:8)
    I am just throwing CustomException , to my knowledge only the constructor should run ?
    What i see is message "this is my exception" is within the toString() method - which i never called.
    From where is the toString() method getting called ?
    Also ,
    If I want an object of my class to be thrown as an exception object, what should I do?

    Your main method is defined as throwing Exception, so the JVM catches the Exception (since nothing in your code does). And it does the equivalent of e.printStackTrace() which, among other things, outputs the result of toString().

  • Internal delivery chnl, file doesn't get picked up, no trace log file gener

    I have defined an internal File delivery channel as part of a trading agreement between host and remote partner (Custom doc over Internet - AS2), configuration including agreement has been deployed, but the file doesn't get picked up. I have made sure that the directory specified in the delivery channel does exist and all permissions are set up (Windows 2003 server).
    A have specified directory for oracle.tip.adapter.b2b.transportTrace property in ip.properties, however no log file gets generated (restarted b2b).
    I am sure it must be something basic I have overlooked, any ideas, folks?

    Thanks again,
    There is an exception in the log file, I guess that explains why the file doesn't get picked up. Not very informative, though :
    2007.11.05 at 12:40:54:856: B2BStarter thread: B2B - (DEBUG) B2BStarter - configuration obtained
    2007.11.05 at 12:40:54:856: B2BStarter thread: B2B - (DEBUG) B2BStarter - clear global cache
    2007.11.05 at 12:40:54:856: B2BStarter thread: Repository - (DEBUG) CacheServiceManager.clearGlobalCache()
    2007.11.05 at 12:40:54:856: B2BStarter thread: B2B - (ERROR) Error -: AIP-50055: Error in configuration file
         at oracle.tip.adapter.b2b.init.Repository.b2bEngineConfiguration(Repository.java:611)
         at oracle.tip.adapter.b2b.init.Repository.initialize(Repository.java:552)
         at oracle.tip.adapter.b2b.init.B2BServer.readRepository(B2BServer.java:432)
         at oracle.tip.adapter.b2b.init.B2BServer.initialize(B2BServer.java:164)
         at oracle.tip.adapter.b2b.init.B2BStarter.startB2B(B2BStarter.java:217)
         at oracle.tip.adapter.b2b.init.B2BStarter.run(B2BStarter.java:104)
         at java.lang.Thread.run(Thread.java:534)

  • Stopping a thread from running

    Hai
         I am new to java. It would be helpful for me if someone helps me out in doing this.
         Actually in my program ,I should
    i. Find out whether a particular file exists in the given directory or not.
    ii. If the file doesn't exist, my program should wait for certain timeframe and check for the same file again.
    iii. If the program cannot find the required file within the timeout specified, my application should exit.
         I have done (i) and (ii) using threads. But in the case of (iii), I came to know that stop() method is depricated.
         I am providing my code for a better understanding. Could you please let me know, what would be the best way to stop the thread from running after the timeout is reached in my program?
    Thanx in advance
    import java.io.File;
    public class Fileexists implements Runnable
    static Thread t;
    public static void main(String[] args)
         System.out.println("creation of object");     
         FileExists test = new FileExists();
         t = new Thread(test);
         t.start();
    // run method
    public void run()
         File f = new File("searchfile.txt");
         boolean b = f.exists();
    System.out.println();
    if(b == false)
    System.out.println("Required file doesnot exists");
    try
         t.sleep(20000);
    catch (InterruptedException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
              t.run();
    else
    System.out.println("Required file found");
    } // end of run()
    } // end of FileExists class

    Actually your use of threads is a difference which makes no difference. The JVM starts an initial thread and runs your main(), at the end of which you start a thread and return. So you've just replaced one thread with another. There's no parallel processing.
    The t.run() at the end of your run() method won't work. A particular Thread object can only run once. It will give you an IllegalStateException.
    I can't see how multi-threading will help you with this task at all, all you need is a simple loop with a Thread.sleep in it.
    If you really want to use a separate thread or Timer to implement a timeout (as an exercise) then use Thread.interrupt() to wind up a thread. The looping thread should test with Thread.interrupted() in it's loop condition, if it's in sleep() when interrupted an InterruptedException will be thrown which you should catch and allow to break the loop and let the thread terminate.
    So your loop structure looks like:
    try {
    while(!Thread.interrupted()) {
        ...  do your test
        Thread.sleep(.....);
      System.out.println("Thread terminated by detecting interrupted");
      } catch(InterruptedException ex)  {
         System.out.println("Thread interrupted from sleep");
    You can get the Thread for the main thread simply by storing Thread.currentThread() in a Thread reference.
    I'd suggest using a java.util.Timer to launch your time-out and leave the loop on the main thread started by the JVM.

  • Trouble rationalizing use of multi-threading in run of the mill servlets

    Hey everybody,
    While spending time writing an internal wiki article on servlets for work, I asked myself a very basic question: What does multi-threading buy average servlets where the business logic requires procedural handling of the request?
    Don't get me wrong: I appreciate the fact that servlet containers spawning a new thread being less expensive than spawning an entirely new process is helpful and efficient. Coming from a background in PHP, it is great how servlets maintain persistence. However, as more of my coworkers are required to gain proficiency in Java and designing servlets, it is a question that many will ask and aside from having real-time processing of data files and other arduous tasks, I cannot think of any instances of where multi-threading benefits the application.
    What are some of the ways that you are using multi-threading with web applications?
    How would you explain why and where you would want to use multi-threading to someone?
    Thank you in advance for your insight,
    Andy

    how can we pass arguments to the run ()method?Create classes which implement Runnable that take your runtime parameters as constructor arguments and store them.
    eg: if your single thread method is   static void foo (int quantity, String name) {
        for (int i=0; i<quantity; i++) {
          System.out.println(name);
    // caller code
      foo(7, "wombats");Then you can make a runnable implementation thus:public class Foo implements Runnable {
      final int quantity_;
      final String name_;
      public Foo (int quantity, String name) {
        quantity_ = quantity;
        name_ = name;
      public void run () {
        for (int i=0; i<quantity_; i++) {
          System.out.println(name_);
    // caller code
      new Thread(new Foo(7, "wombats")).start();
    You could overload this method to take parameters in
    your class that implements the Runnable interface,
    and then call the base run() method.I don't get what you mean by this; Runnable is an interface so there is no base class run() method, and a run() overloaded with extra parameters method wouldn't get called by the thread.
    Pete

  • Java Thread.. System Clock gets slower..

    Hello All!
    I have never came accross such problem in my last 4 years of java development but right now its sucking my brain like any thing..
    Let me clerify what my application is doing.
    A node which is basically thread is executed and as it performs its job it is stopped by breaking the while loop like logic and then a method isRunnable() is called to calculate the time to run the thread again on the basis of pre-defined schedule (e.g. after 1 minute). so what i was doing in this method i was calling wait (sheduledMinutes*60*1000).
    There are multiple nodes which can be run in parallel. Problem occured when some nodes started immediately or after a time much shorter than the value defined in wait() method.
    So as an alternative way i decided to not rely on wait() and wrote my own implementaion i.e. i call wait(1000) in isRunnable() and the check if the current system time is less then the scheduled time. But it didn't work either.
    The problem revealed when i printed the valued of current time taken by the system and the scheduled one. The System clock gives the current time which is less than the actual System time shown on windows clock. I dont know why but it seems like as my threads continue to run the system clock gets slower or something and returns an old time. Hence nodes start immediately.
    Any solution to this problem would be highly appreciable.
    Regards,

    Well yeah u r right. I figured it out that it was just my threads running slowly. But the threads ran immediately there was another reason for that. My threads were waiting for the sheduled minutes to run again. In the mean while if i presed the stop button to stop the thread i was just setting the stop variable value to true. Which was basically the check in the while loop in run method. U can notice the thread still sleeping due to the call to wait method. And then if again mean while i press start button i called System.gc(). and then pass the current thread to new Thread like Threa t = new Thread(node); t.start();
    Now u can c another thread has been created but the last one was not collected by the garbage collector as it was still waiting and doing something ofcourse not dead. So now when new thread stops these was a possiblity of last thread ( one in waiting state) to run according to schedule and it make the current thread run immediately.
    I hope u can understand how difficult it was for me to figure this thing out :)
    But after 3/4 hours hair tearing i got the bug and then when i was stopping a thread i infact broke the waiting loop as well. Now the thread was dead and collected by garbage collector before new thread could start :)
    Hhhhhhhhhhhhhh sometimes programmign really sucks.
    Have fun. and thanx for ur concern..
    Regards

  • Making animation using java, need help, image doesn't get painted

    I was trying to make some sort of animation and it is done by painting a head and a body at a time. The problem is the body never gets painted but the head is perfect. Unless I replace the int variable within imgBodypics[int variable] with a variable at counts from 0 to N or an integer , the body doesn't get painted, that is not what i want, as the images that make up the animation consists of 8 frames starting from the image006.gif ~ image014.gif
    import java.awt.Image;
    import java.awt.Graphics;
    import java.awt.Color;
    public class Knight extends java.applet.Applet implements Runnable {
         Image imgBodypics[]= new Image[115];
         Image imgHeadpics[]= new Image[15];
         Image imgCurrentbody, imgCurrenthead;
         int intBodyposx,intBodyposy,intHeadposx,intHeadposy;
         int brainwalkxpos,brainwalkypos,bodywalkxpos,bodywalkypos;
         Thread thdRunner;
         public void init() {
              for (int i=0;i < 115; i++){
                   imgBodypics[i] = getImage(getCodeBase(),"images/knight/knight000"+i+".gif");
              for (int i=0;i < 15; i++){               
                   imgHeadpics[i] = getImage(getCodeBase(),"images/headboy02/headboy02000"+i+".gif");
         public void start() {
              if (thdRunner == null) {
                   thdRunner = new Thread(this);
                   thdRunner.start();
         public void stop() {
              if (thdRunner != null) {
                   thdRunner.stop();
                   thdRunner = null;
         public void paint(Graphics g) {
              g.drawImage(imgCurrentbody, intBodyposx, intBodyposy,this);
              g.drawImage(imgCurrenthead, intHeadposx, intHeadposy,this);
         public void walk(int intNumtimes, String strDirection) {
         int intDirectionx,intDirectiony,intBodyimagecode;
              if (strDirection == "down")      {     intDirectionx = 0;
                                                      intDirectiony = 1;
                                                      intBodyimagecode = 6;}
              else if(strDirection == "leftdown"){intDirectionx =-1;
                                                      intDirectiony =1;
                                                      intBodyimagecode = 14;}
              else if(strDirection == "left") {     intDirectionx = -1;
                                                      intDirectiony = 0;
                                                      intBodyimagecode = 22;}
              else if(strDirection =="leftup") {     intDirectionx =-1;
                                                      intDirectiony =-1;
                                                      intBodyimagecode = 30;}
              else if(strDirection == "up")      {     intDirectionx = 0;
                                                      intDirectiony = -1;
                                                      intBodyimagecode = 38;}
              else if(strDirection =="rightdown") {intDirectionx =1;
                                                      intDirectiony =1;
                                                      intBodyimagecode = 14;}
              else if(strDirection == "right") {     intDirectionx = 1;
                                                      intDirectiony = 0;
                                                      intBodyimagecode = 22;}
              else if(strDirection =="rightup") {     intDirectionx =1;
                                                      intDirectiony =-1;
                                                      intBodyimagecode = 30;}
              else{      intDirectionx = 0;
                        intDirectiony = 0;
                        intBodyimagecode = 6;}
              int intLastBodyimagecode = intBodyimagecode + 8;
              int intFirstBodyimagecode = intBodyimagecode;
         for (int intCount = intNumtimes; intCount > 0; intCount--){
              for (int i = 0; i < 8; i++){
              int intJ,intI;
              intJ = i;
              intI = intBodyimagecode + i;
              imgCurrentbody = imgBodypics[intI];
              intBodyposx = 250 - (imgCurrentbody.getWidth(this) / 2) + (intDirectionx * intJ * 12);
              intBodyposy = 200 - (imgCurrentbody.getHeight(this) / 2) + (intDirectiony * intJ * 12);
              imgCurrenthead = imgHeadpics[intJ];
              intHeadposx = 250 - (imgCurrenthead.getWidth(this) / 2) + (intDirectionx * intJ * 12);
              intHeadposy = 200 - (imgCurrenthead.getHeight(this) / 2) + (intDirectiony * intJ * 12);
              repaint();
              intBodyimagecode++;
              try { Thread.sleep(200); }
              catch (InterruptedException e) { }
         public void update(Graphics g) {
         paint(g);
         public void run() {
              setBackground(Color.lightGray);
              walk(1, "left");
              walk(1, "right");
              walk(1, "up");
              try {Thread.currentThread().sleep(5000);}
              catch (InterruptedException e) { }

    Erm, i tried to highlight the code and then press the code tag but after posting it is still plain, and there is no way to edit the post, sorry about that, next time i'll try. About the book "Filthy Rich Clients", no i don't have it, is there any free version of similiar resources?
    testing123

  • Program freezes when a thread is run in another class.

    I have a class that extends Thread, and then I have a GUI that needs this thread.
    The thread class looks like this:
    public class ScoreboardCheck extends Thread
        private int clock;
        private boolean running;
        public ScoreboardCheck(int timeOnClock)
            super();
            this.clock = timeOnClock;
            running = false;
        public int getClock()
            return this.clock;
        public void toggleRunning()
            if (running == false)
                running = true;
            else
                running = false;
        public void run()
            while (Thread.currentThread() == this)
                if (running == true)
                    try
                        Thread.sleep(1000);
                        clock--;
                    catch(InterruptedException ie)
                        ie.printStackTrace();
    }This is suppose to update the clock on the GUI. I instantiate the thread in the GUI class, and call start on it. This works fine, but whenever I call run, it freezes up....Either way it never does anything.
    In the GUI class, how am I suppose to continously update the clock without this thing freezing up? I've tried implementing runnable in the GUI class, but that didn't work.

    Thanks for the replies, guys.
    When I call start it doesn't freeze. That's good. The only other problem I'm faced with, is updating the GUI probably every second. I've tried using a run method in the GUI which runs while true, but that froze things up....This is the point I'm stuck at. For now, I'm going to try what someone suggested: the Timer class. Is there another way of doing this though? Without the timer?

Maybe you are looking for

  • I have 3rd generation iPad retina and it seriously overheats?

    I have I pad 3rd generation retina display and purchased this after 2nd generation was stolen and found overseas (had no home insurance) as recently was going through a bad 24 year marriage divorce and had to stop working a month later due to illness

  • Got a New MacBook!! (And a few questions)

    Hello everyone... I've finally switched to Mac! Well... I'm halfway in the process. Right now I'm typing this on my PC. I'm completely new to the world of Mac, and if you could help me with some questions I have, I'd really appreciate it! 1. How fast

  • My 4S phone is turning off but is fully charged

    My iphone is turning off but is fully charged.  If I recharge, would turn back on. Now it is just giving me "no service" and can only call out emergency

  • What is best way to link two interactive reports?

    Hi, ================= Basic Set UP ================= I've created two interactive reports-- Project report in Project page and Task report in Task page. Project report in Project page can contain multiple projects. Task report in Task page can contai

  • Everybody PLEASE read.... Flash Problems

    People are becoming more vulnerable since they have tried everything from UNinstalling then re-INstalling the Adobe Flash player version 9/10/and whatever comes after this. There are quick fixes that are not even approved by Adobe people who really n