List of usage examples for java.lang Thread interrupt
public void interrupt()
From source file:src.gui.ItSIMPLE.java
@Override public void windowClosing(WindowEvent evt) { if (itsimpleInst != null) { //Kill all threads if (itsimpleInst.getExe() != null) { itsimpleInst.getExe().destroyProcess(); }//from www . j a v a 2s. com Thread currentThread = itsimpleInst.getCurrentThread(); if (currentThread != null && currentThread.isAlive()) { currentThread.interrupt(); } Thread plannerThread = itsimpleInst.getPlannerThread(); if (plannerThread != null && plannerThread.isAlive()) { plannerThread.interrupt(); } } System.exit(0); }