对我来说效果很好:
public class Reader extends SwingWorker<List<String>, String> { protected List<String> doInBackground() throws Exception { ArrayList<String> lstText = new ArrayList<String>(25); BufferedReader in = null; try { FileReader read = new FileReader("Scanner.txt"); in = new BufferedReader(read); String s = null; while ((s = in.readLine()) != null) { lstText.add(s); publish(s); } } finally { try { in.close(); } catch (Exception e) { } } return lstText; } @Override protected void process(List<String> chunks) { for (String text : chunks) { fldText.append(text + "n"); } } @Override protected void done() { }}


