Well this is the third time I ask this question, this time I try give you enough information and I have also read from the beginning of the
java tutorial on sun's website to the lesson about threads. In my last post you said i should read about event listeners but i don't believe the problem is in there.
I want an Integer to rise by 1 every second while I have left arrow button pressed and then stop rising when I relase it. I tried somehow make an inner class which would be the tread which starts and stops when I press and relase the left arrow button.
But when I run the program (I have a println method which shows the value of heading360) it first prints out 2's, then when I press left arrow it prints 0's for like 1 sec and then prints 1's till I end the program. I believe the problem is that I don't really undertand how threads work. I read from the tutorial but I couldn't use the examples for this.
Below is the code I'm using. I have removed parts of the code. I'll post more if I have forgot to write a part you need to see.
You can download the whole source code here:
Killers.java [ March 09, 2005: Message edited by: Tomm Schuman ]
[ March 09, 2005: Message edited by: Tomm Schuman ]