Void initTextPane()
{//将文本框放入有滚动条对象,并加入到Frame中
getContentPane().add(new JScrollPane(text));
} Void应该写成void这里被认为是一个对象了。所以要求应该返回Void。但实际上你这个是希望不返回的。
{//将文本框放入有滚动条对象,并加入到Frame中
getContentPane().add(new JScrollPane(text));
} Void应该写成void这里被认为是一个对象了。所以要求应该返回Void。但实际上你这个是希望不返回的。
{//读入文件,并将字符置入文本框中
try
{ FileReader fr = new FileReader(file);
int len = (int)file.length();
// fr.read(buffer,0,len);
fr.close();
// text.setText(new String(buffer));
}
catch (Exception e){e.printStackTrace();}
}
上边这两条加注释的语句,在编译时老是错误,FileReader这个函数不知道怎么样用,请各位大侠们再帮帮小弟