我正在尝试学习 SwingWorker 但遇到以下错误。我不知道如何解决这个问题。错误显示在代码的注释部分。包learnswingworker;
import java.awt.List;
import java.util.ArrayList;
import javax.swing.SwingWorker;
public class Try extends SwingWorker<ArrayList<Integer>, Integer>{
@Override
protected ArrayList<Integer> doInBackground() throws Exception {
ArrayList<Integer> primeNumbers = new ArrayList<Integer>();
Integer i=4;
boolean divisibleYet = false;
while(true){
for(Integer k=2;k<=(i/2);k++){
if(i%k==0){
divisibleYet=true;
}
}
if(!divisibleYet){
publish(i);
}
i++;
divisibleYet=false;
}
}
@Override // Shows ERROR ::: Method does not Override or Implement a method from a supertype.
protected void process(List<Integer> chunks){ // Shows ERROR ::: Type List does not take parameters.
}
}