Results 1 to 2 of 2
  1. #1
    narbeh is offline Member
    Join Date
    Mar 2009
    Posts
    1
    Rep Power
    0

    Question an old question about Thread.Sleep()

    Hello guys,

    I know this is an old question to ask, but I am a beginner in Java. I codded a small program in JFrame and I used Thread.Sleep() to give delay, but obviously the window of my program freezes until the job is done and then shows the result, but I do not want it like that! I want my window to become active again after delay.

    I used this code:

    try
    {Thread.sleep(500);
    }
    catch (InterruptedException e){};

    Can you please tell me, how to keep my window active?
    Thank you in advance :D

  2. #2
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    Hi ,

    Just create a seprate thread n put ur process in that thread n make it run seprately in different stack in that way u can handle ur problem.

Similar Threads

  1. Difference between Thread.yield() and Thread.sleep() methods
    By Nageswara Rao Mothukuri in forum New To Java
    Replies: 12
    Last Post: 07-30-2010, 05:37 PM
  2. Thread.sleep() question
    By Lachezar in forum New To Java
    Replies: 5
    Last Post: 02-03-2009, 10:27 PM
  3. Sleep in thread
    By jithan in forum New To Java
    Replies: 1
    Last Post: 08-27-2008, 02:27 PM
  4. Can't get my thread to sleep!
    By jamesfrize in forum New To Java
    Replies: 2
    Last Post: 03-25-2008, 05:14 AM
  5. How to use the sleep and thread?
    By jiuhu in forum Java Applets
    Replies: 4
    Last Post: 08-07-2007, 02:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •