Results 1 to 2 of 2

Thread: [RESOLVED] Update JLabel every second

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    9

    Resolved [RESOLVED] Update JLabel every second

    I currently have a Jframe with a JLabel on it and I have a thread that just increments a counter and sleeps for 2000. My problem is I tried to display the counter's value in the JLabel every 1000 ms and it will not work. So I was wondering how I update a JLabel if I create a new class and thread that class and I need to display information in that class on a form in another class.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Update JLabel every second

    use javax.swing.Timer instead of a thread
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

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



Click Here to Expand Forum to Full Width