I Need Some Help for Timer

I have these two methods:

publicvoid init()

{

getContentPane().add(imagePanel);

}

publicvoid setSpeed(int sleepTime)

{

timer.setDelay(sleepTime);

}

How do i invoke the method setSpeed(int sleepTime) with a line of code inside the init() method?

Many thanks.

[612 byte] By [pinkjewelsa] at [2007-10-2 20:19:46]
# 1
Sorry i need to invoke the method because i need to change the speed of the timer
pinkjewelsa at 2007-7-13 23:02:00 > top of Java-index,Desktop,Core GUI APIs...
# 2
I am not sure what you are asking.How about:setSpeed(2) or setSpeed(whateveryournewtimespeed)Not enough detail here, please be more specific.
artfuldodgera at 2007-7-13 23:02:00 > top of Java-index,Desktop,Core GUI APIs...
# 3
call it just like you would any other method.
BaltimoreJohna at 2007-7-13 23:02:00 > top of Java-index,Desktop,Core GUI APIs...
# 4
Ok put it this way...I want to change the timer speed.How do i write a a line of code inside the init() method to invoke the setSpeed(int sleepTime) method...
pinkjewelsa at 2007-7-13 23:02:00 > top of Java-index,Desktop,Core GUI APIs...
# 5
public void init(){getContentPane().add(imagePanel);setSpeed(12); }
BaltimoreJohna at 2007-7-13 23:02:00 > top of Java-index,Desktop,Core GUI APIs...
# 6
Many thanks.
pinkjewelsa at 2007-7-13 23:02:00 > top of Java-index,Desktop,Core GUI APIs...