界面设计 能在事情监听器里再添加组件吗?

我想问一下在界面设计里,能不能在事情监听器里再添加文本框
Open.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JTextArea editor=new JTextArea();//创建一个文本框
JScrollPane sp=new JScrollPane(editor);//创建一个滚动条面板,将文本框放在该面板上
f.add(sp,BorderLayout.CENTER);//将滚动条面板放在窗口的中间位置
JFileChooser fc1=new JFileChooser();
int r=fc1.showOpenDialog(f);
if(r==JFileChooser.APPROVE_OPTION) {
File fselect=fc1.getSelectedFile();
try {
editor.read(new FileReader(fselect),null);
}catch(IOException e1) {}
}
}
});
我这样做只能打开文件,而创建不了一个文本框

https://blog.csdn.net/u012575573/article/details/25876655