analysisThread.interrupt(); }
int option = JOptionPane.showConfirmDialog(this, "Cancel analysis?", "Analysis", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);  if (option == JOptionPane.YES_OPTION) {   analysisThread.interrupt(); } }
    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed        // All we need to do to cancel the analysis is to interrupt        // the analysis thread.        analysisThread.interrupt();    }//GEN-LAST:event_cancelButtonActionPerformed