i don't know what i've done wrong here.....
Please help me....
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
/**
* Write a description of class cc_Clock here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class cc_Clock extends Actor
{
private long startingTime;
private boolean counting = false;
/**
* Act - do whatever the cc_Clock wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (counting)
{
displayTime(System.currentTimeMillis() - startingTime);
}
}
private void displayTime(long time)
{
time/=1000;
int minutes = (int) time / 60;
int seconds = (int) time % 60;
String Time = minutes + ":" + seconds;
setImage(new GreenfootImage(Time, 30, Color.black, new Color(0, 0, 0, 0)));
}
public void startClock()
{
counting = true;
startingTime = System.currentTimeMillis();
}
public String getTime()
{
time /= 1000;
int minutes = time / 60;
int seconds = time %60;
String time = minutes + ":" + seconds;
return time;
}
}

