posted 18 years ago
Thanks, I ran your program but minus the javax.swing.timer part at the bottom, and it works fine, but thats essentially what mine is. And mine works like that.
But I need to restart the timer after the mouse has been released,
The button press (start button) is just to start the chess game, and
when you release a piece over a square... this should invoke the timer to start while the computer thinks about his move... but whats happening is that the computer keeps thinking forever.
Its only when we start the game with computer having first go, and when we click the start button that timer.start() works.
Perhaps if you could implement the MouseListener interface, so that mouseReleased(MouseEvent e) triggers timer.start(), as well as triggering it from the start button.
I can't seem to do it, I'll try it with your code though, and if you could try to, that would be great.
Thanks for your help