I have the following code...
runNow.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
final Search s = (Search) node.getUserObject();
// Swing worker
SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
@Override
public Void doInBackground() {
s.run();
return null;
}
@Override
public void done() {
window.updateResultsPanel(s.getResults(), s.getName());
}
};
worker.run();
}
});
This is a popup menu action which should create a new SwingWorker, free up the GUI, do some work, then update the results of the window. However, right now when I click the menu item the GUI becomes locked up until the work completes which is baffling, the whole point of using a SwingWorker is so that won't happen.
Any ideas as to what I'm doing wrong would be greatly appreciated.
-Cody