I have problem about applied SwingWorker with FileReader and my point is I need to implement FileReader with SwingWorker to make my UI Show the text from the file and this is my code
class Read1 extends SwingWorker<String,String>{
protected Void doInBackground() throws Exception{
FileReader read = new FileReader("msg.txt");
BufferedReader in = new BufferedReader(read);
String s;
s=in.readLine();
System.out.println(s);
return s;
}
protected void done()
{
try{
String show;
show=get();
textArea.append(show);}catch(Exception e){}}
public static void main(String args[]) {
Read1 r = new Form().new Read1();
r.execute();
However it does not append anything on the UI textarea
anyone have solution? Thank you