Results 1 to 2 of 2
  1. #1
    wallys is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Smile Setting a timeinterval callback ???

    Hi,

    I'm new to Java, and have a probably easy question...
    I'm wondering if it's possible to define something like a setInterval so Java will call a function avec few seconds ? If so how to do it ?

    Something like :
    -------------------------------------
    class Program
    {
    public Program()
    {
    Timer.setInterval(doSomething, 5000);
    }

    public void doSomething() {
    //My function to be called after 5 seconds
    }
    }
    -------------------------------------

    Thanks.
    Last edited by wallys; 08-19-2008 at 06:23 PM. Reason: Add details

  2. #2
    wallys is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default

    Après avoir obtenu des réponses sur d'autres forums, il faut utiliser les classes Timer, et TimerTask de java.

Similar Threads

  1. Setting up CVS using Eclipse???
    By JavaInLove in forum Eclipse
    Replies: 1
    Last Post: 07-18-2008, 03:03 PM
  2. Setting the DSN
    By tim in forum JDBC
    Replies: 1
    Last Post: 02-14-2008, 10:55 PM
  3. JTextArea setting
    By newtojava7 in forum New To Java
    Replies: 1
    Last Post: 01-29-2008, 03:57 AM
  4. Help with setting up please
    By BlitzA in forum New To Java
    Replies: 6
    Last Post: 12-29-2007, 01:54 PM

Posting Permissions

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