Newbie with a timer question

From: Matt Revenaugh (matt_at_mybogusaccount.com)
Date: 10/24/03


Date: Thu, 23 Oct 2003 22:07:52 GMT

OK, so I am a newbie to java. I've been programming for a looong time
though. I am trying to set up a timer that opens a new browser window every
so often. I am trying to avoid using the <META refresh...> tag. But I can
not seem to get the code to work.

Below is the snippet from my web page.

What am I doing wrong. Is it the way I am declaring the classes? Or is it
something deeper that I have not yet learned. Any help from you java gurus
is welcomed!

Matt Revenaugh
Java Newbie

- - - - - - - - -

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--

import java.util.Timer;
import java.util.TimerTask;

public class Reminder {
    Timer timer;
    
    public Reminder(){
        timer = new Timer();
        timer.schedule(new RemindTask(), 60000);
    }
    
    class RemindTask extends TimerTask {
        public void run(){
        open("http://www.myurl/mypage.htm", "myRemote", "fullscreen=1");
        }
    }
    
    public static void main(String[] args){
        new Reminder();
    }
}

// -->
</SCRIPT>
</HEAD>
<BODY></BODY>
</HTML>



Relevant Pages

  • Re: Newbie with a timer question
    ... so I am a newbie to java. ... I am trying to set up a timer that opens a new browser window every ... javascript & not java code. ...
    (comp.lang.java)
  • Re: Java Timer, swing
    ... > virtual machines which you have to download from the website like some jre. ... > I quess the swing library isn't supported by a lot of virtual machines. ... Using a simple Timer like the swing version and ... Swing is not part of the basic java.* distribution. ...
    (comp.lang.java.programmer)
  • Email send retry
    ... I have to write code to send an email and if for some reason it is not ... String sFrom; ... Timer timer; ... //Need to delete this object here, no idea how this happens in java ...
    (comp.lang.java.programmer)
  • Re: How do timers work?
    ... > This is probably not a java specific question. ... the Java timer uses the system timer function at its ... The scheduler is usually activated every xxx msecs (h/w ... So, usually there are no busy waiting loops involved whatsoever, since ...
    (comp.lang.java.programmer)
  • matlab GUI - Stand-alone app CRASH
    ... The exe looks okay but when a push the START button(the one with the timer) BOOM! ... An unexpected exception has been detected in native code outside the VM. ... Current Java thread: ...
    (comp.soft-sys.matlab)