Java tutorial
//package com.java2s; public class Main { /** * Checks if the current thread * * @throws InterruptedException if the current thread was interrupted */ public static void checkIfInterrupted() throws InterruptedException { // make this thread interruptible, if called from SwingWorker if (Thread.interrupted()) { throw new InterruptedException(); } } }