Search code examples
javaswingworker

Pass data to swingWorker?


Is there a way to pass data e.g an object to the swingWorker before invoking "swingWorker.execute"?


Solution

  • Normally I handle this by making the constructor of my SwingWorker require the needed objects. That way the compiler will force me to remember to pass the variable.