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: Thread Sleep, Timer, Button Question

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    12
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Thread Sleep, Timer, Button Question

    hiya guys,

    At the moment I'm using thread sleep to pause the timer but this will also make the buttons unresponsive during the time the thread is asleep. Is there a simple way around this??? Any ideas will be much appreciated.

    thank-you


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Thread Sleep, Timer, Button Question

    If you're using Swing, you can have all your main GUI responses happen on the main Swing thread and process other commands/waits using a SwingUtility thread.

    see: Concurency in Swing

  3. The Following User Says Thank You to helloworld922 For This Useful Post:

    tabutcher (May 2nd, 2010)

Similar Threads

  1. How to Use Timer in Java
    By neo_2010 in forum Java SE API Tutorials
    Replies: 2
    Last Post: August 6th, 2013, 09:49 AM
  2. Thread/timer problem
    By korbal in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 18th, 2010, 05:59 PM
  3. Timer Class help
    By Deadbob in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 23rd, 2010, 12:18 AM
  4. Replies: 4
    Last Post: February 4th, 2010, 03:21 AM
  5. Timer?
    By TimW in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: October 27th, 2009, 07:43 AM