草庐IT

java - 如何将参数传递给 SwingWorker?

我正在尝试在我的GUI中实现Swingworker。目前我有一个包含按钮的JFrame。当按下它时,它应该更新显示的选项卡,然后在后台线程中运行程序。这是我目前所拥有的。classClassA{privatestaticvoidaddRunButton(){JButtonrunButton=newJButton("Run");runButton.setEnabled(false);runButton.addActionListener(newActionListener(){publicvoidactionPerformed(ActionEvente){newClassB().exec