填空题

以下应用程序的界面中有一个用于输入文件名的文本框对象fileName、一个用于输入匹配字符串的文本框对象p,和一个用于输出的文本区对象text。程序运行时,用户输入匹配字符串和文件名,程序逐行读入文件的内容,检出那些以匹配字符串开头的行并显示在文本区中。
public void actionPerformed(ActionEvent e){
String s;
if(e.getSource()==fileName){
try{ in=new BufferedReader(new______);
} catch(FileNotFoundException e1){
System.out.print("File Not found!\n");
}
text.setText(null);
try{
while((s=______)!=null){
if(s.startsWith(p.getText())) text.append(s+"\n");
}
}catch(IOException exp){ System.out.print("File read error! \n");
}
}
}

【参考答案】

FileReader(fileName.getText())
in.readLine()