Timer as an inner class
- From: "raam" <muthuramantripura@xxxxxxxxx>
- Date: 30 Mar 2006 05:39:20 -0800
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
.
- Follow-Ups:
- Re: Timer as an inner class
- From: raam
- Re: Timer as an inner class
- From: Allan M. Bruce
- Re: Timer as an inner class
- Prev by Date: Re: Gui Question
- Next by Date: Re: help needed - decompiling
- Previous by thread: integers and arrays inJava - how?
- Next by thread: Re: Timer as an inner class
- Index(es):
Relevant Pages
|