问题
填空题
以下程序的界面有一个文本区text,一个按钮button。程序运行时,单击按钮,则将文本区中的内容输出到out,其中out为BufferWriter类的一个对象。
public void actionPerformed(ActionEvent e)
String s;
if(e.______==button)
try
out.______(text. getText(),0,(text. getText()).length());
out. flush();
text. setText(null);
System. exit(0);
catch(IOException exp)
text. setText("文件写出错!\n");System. exit(-1);
答案
参考答案:getSource()
write