keeping time in an applet?
843807Jan 3 2003 — edited Jan 4 2003hello, i'm a java newbie, and i recently wrote a game called MineSeeker that is like Minesweeper. i turned it into an applet, and that can be found at http://cvchen.digitalrice.com/m_seek.html
anyhow... i was wondering how i would go about creating a "timer" for the applet. one way that i've thought up is something like this:
while(gameStat == GOING)
{
time++;
timePanel.setText(time);
timePanel.paintImmdediately(0, 0, timePanel.getWidth(), timePanel.getHeight());
Thread.sleep(1000);
}
however, this entails multi-threading that that's a bit out of my league as of yet. also, potential problems that i think i foresee would be that the clock in the timePanel would update at different speeds on different people's computers, depending on their computer specs.
help, please... anyone?