How to Stop a SwingWorker?
问题 How can I stop the SwingWorker doing his work? I know there's the cancel() method for that, but the most I could do is to anonymously create a new SwingWorker that is doing the job. Here is the code for reference: public void mostrarResultado(final ResultSet resultado) { new SwingWorker<Void, Object[]>() { @Override public Void doInBackground() { // TODO: Process ResultSet and create Rows. Call publish() for every N rows created.+ DefaultTableModel modelo = new DefaultTableModel();