This should be a nobrainer, i've died easily hundred of times because my game froze or i was hit by a lag spike resulting my character walking without my input in the direction i was taking before it happened and walked in effect into a trap/swarm of monsters.
You'll have to talk to Sun about garbage collection in Java, since its the cause of that behavior. When ever it needs to free up memory, it has to pause the thread, clean up, then catches up on anything that got back logged during that time. While the thread is paused, it can't monitor for input changes since code isn't being executed.
Its the price you pay when working with the java platform.