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.


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

Results 1 to 2 of 2

Thread: Timer expiry calls a method

  1. #1
    Join Date
    Jun 2011
    My Mood
    Thanked 0 Times in 0 Posts

    Default Timer expiry calls a method

    Can you guide me to design a simple logic to invoke a mehtod in main() when a timer expires after 5 seconds?
    how can i do this..
    I am not using GUI

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,272 Times in 2,244 Posts

    Default Re: Timer expiry calls a method

    Look at the Swing Timer class. There is sample code in the API doc.

Similar Threads

  1. Timer expires invoke method
    By jack_nutt in forum What's Wrong With My Code?
    Replies: 7
    Last Post: July 11th, 2011, 05:52 PM
  2. Case statements to Method calls???
    By Java Neil in forum Java Theory & Questions
    Replies: 1
    Last Post: February 24th, 2011, 05:17 AM
  3. [SOLVED] A Final method for DoublyLinkedList and a new class that calls DoublyLinkedList.
    By javapenguin in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 12th, 2010, 07:29 PM
  4. Need help understanding method calls and such
    By hackman2007 in forum Java Theory & Questions
    Replies: 8
    Last Post: July 14th, 2010, 08:18 AM
  5. Any way to map method calls?
    By Swiftslide in forum Collections and Generics
    Replies: 1
    Last Post: September 21st, 2009, 04:37 AM