@Override public void run() { action.performAction(); // Attempt to make it more responsive to key-releases. // Even if there are multiple this-tasks piled up (due to // "scheduleAtFixedRate") we don't want this thread to take // precedence over AWT thread. Thread.yield(); } };
if ((action == null) || !action.shouldPerformAction()) { continue; startRepeating(kcb, action); } else { action.performAction(); stopRepeating(kcb); if (action.hasReleaseAction()) { action.releaseAction();