Timer as an inner class



Hi all,
I am trying to use a timer to make a label blink in a frame.I am adding
a class inside the frame for this purpose.But whe i compile it says '
<identifier > expected at the line

timer.schedule( <-here task,period);
I hve given the code below.Can anyone please help.
Raam

Code:

class Tmier {
int delay = 5000; // delay for 5 sec.
int period = 1000; // repeat every sec.
java.util.Timer timer = new java.util.Timer();
class task extends TimerTask{
public void run() {
if(LQ.getForeground().equals(Color.RED))
LQ.setForeground(LQ.getBackground());
else
LQ.setForeground(Color.RED);

repaint();
}
}
timer.schedule(task,period);
}//Inner class Timer

.



Relevant Pages

  • Re: Scrolling text in a stationary label help needed
    ... single pixel scroll just once in each Timer event, ... and displaying the "scrolling text in a transparent picture box" if it ... exactly correspond to the video "frame rate" (75 frames per second in the ... rest of your code could use that 3.3 milliseconds to do something else. ...
    (microsoft.public.vb.general.discussion)
  • Re: Turning off some messages - is it possible? Is it unnecessary?
    ... However, in the gaming domain, responsiveness (not efficiency) is the problem. ... >10ms per frame. ... the first thing I did was create a timer to ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: LXI, IEEE1588 and TTP
    ... > addition to these protocols. ... A sends a synchronisation frame to B and starts a timer when ... B reads the time at wich it receives the character and starts ... B sends a reply frame, reads the timer when the equivalent ...
    (comp.arch.embedded)
  • Re: Turning off some messages - is it possible? Is it unnecessary?
    ... 10ms per frame. ... 20-25cps so at the most you can only get one character every 40ms or so. ... the first thing I did was create a timer to ... > O.K. DirectInput for getting controller input, ...
    (microsoft.public.vc.mfc)
  • GUIs and Timers
    ... picture. ... I've been trying to use a timer to redraw the video ... function it puts the frame in a new window. ... have the same problem using guide-created code): ...
    (comp.soft-sys.matlab)