Results 1 to 3 of 3

Thread: Running Timer

  1. #1
    Doctor Cactus is offline Member
    Join Date
    Oct 2008
    Posts
    63
    Rep Power
    0

    Default Running Timer

    Hi, i was wondering how to show a running timer in a JLabel? I can start and stop the timer, I just want to see the timer in the JLabel counting 1,2,3 etc until I stop it.
    Help is greatly appreciated.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    Let's see what you're trying, in the form of an SSCCE.
    SSCCE : Java Glossary

    db

  3. #3
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    282
    Rep Power
    6

    Default

    In run method of you TimerTask class use setText method JLabel class

    public void run(){
    jLblObj.setText(somecountervalue);
    somecountervalue++;
    }

Similar Threads

  1. EJB Timer
    By mrjunsy in forum Advanced Java
    Replies: 0
    Last Post: 08-22-2008, 04:09 PM
  2. EJB Timer
    By mrjunsy in forum New To Java
    Replies: 0
    Last Post: 08-04-2008, 06:47 PM
  3. Replies: 0
    Last Post: 04-04-2008, 02:46 PM
  4. Page Timer
    By deeadeed in forum New To Java
    Replies: 0
    Last Post: 12-05-2007, 08:44 PM
  5. problem with timer
    By Marcus in forum Advanced Java
    Replies: 2
    Last Post: 07-01-2007, 05:13 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
  •