Timer help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • natasha9449
    New Member
    • Jan 2008
    • 1

    Timer help

    Hi.. i have a small doubt in Java and was wondering if you could help me..

    I need to set a timer for my desktop GUI application... after the timer expires it should give a message saying that time is up!

    How can i do this?? i've googled it.. and i need to use "timer", but timer is for invoking something after a delay... so.. what should i do??
  • sandeepsandeep
    New Member
    • Dec 2006
    • 50

    #2
    Timer class does not offer real-time guarantees: it schedules tasks using the Object.wait(lon g) method

    Comment

    • BigDaddyLH
      Recognized Expert Top Contributor
      • Dec 2007
      • 1216

      #3
      Originally posted by sandeepsandeep
      Timer class does not offer real-time guarantees: it schedules tasks using the Object.wait(lon g) method
      I don't see the relevance of this comment. Why should a "Times up!" message need a hard real-time guarantee?

      Anyhowdy, to learn more about javax.swing.Tim er, take the tutorial on it:

      This Swing Java Tutorial describes developing graphical user interfaces (GUIs) for applications and applets using Swing components

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by BigDaddyLH
        Why should a "Times up!" message need a hard real-time guarantee?
        Maybe because you don't want MaryAnn to turn in her work on time and have
        BillyBob peek around for another ~ 1/100 second or so?

        kind regards,

        Jos ;-)

        Comment

        Working...