How do I set a boolean for a specified amount of time, then reset it?
سؤال
I basically want a method I can call that will set a boolean to true for 2 seconds, then reset it to false. How would I do this?
I'm using the Slick library which is dependent on LWJGL.
المحلول
You want to look at the Timer class.
نصائح أخرى
check out the ScheduledExecutorService and the method schedule()
لا تنتمي إلى StackOverflow