IF I put the declaration of some components into the method of 'actionPerformed',for
example,
JTextArea ErrorMsg=new JTextArea(4,10);

Why it doesn't work?

Thank you!