Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Pausing an operation without freezing the entire client

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    6
    My Mood
    Happy
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Pausing an operation without freezing the entire client

    This is the code I have
    checkUser = false;
    loginMessage2 = "Error connecting to server.";
    		try {
    			Thread.sleep(5000);
    		} catch (InterruptedException e) {
    			e.printStackTrace();
    		}
    		checkUser = true;

    What I want to do is add a delay between boolean changes, without the whole client freezing up

    Any help would be appreciated


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Pausing an operation without freezing the entire client

    Use a helper thread to do what you've shown above while the client continues to run on another thread.

Similar Threads

  1. proxy checker keeps freezing
    By bean in forum What's Wrong With My Code?
    Replies: 13
    Last Post: June 3rd, 2013, 02:45 PM
  2. About deleting image on a certain time without the pausing
    By poldz123 in forum Java Theory & Questions
    Replies: 1
    Last Post: February 18th, 2013, 07:26 AM
  3. Problem with Java Update freezing application
    By banny7 in forum Java Theory & Questions
    Replies: 0
    Last Post: October 25th, 2011, 12:36 PM
  4. Pausing a loop until a button is pressed
    By amcqueen in forum AWT / Java Swing
    Replies: 1
    Last Post: October 5th, 2011, 01:57 AM
  5. Freezing on bust (BlackJack)
    By DaffyPWNS in forum What's Wrong With My Code?
    Replies: 9
    Last Post: June 16th, 2011, 09:40 PM

Tags for this Thread