【发布时间】:2017-08-04 18:09:22
【问题描述】:
我已经创建了一个项目。但是我在控制台中获取数据我想将数据设置为 textarea
File[] F=File.listFiles();
for (File File1:F) {
FileInputStream fstream = null;
String strLine ;
try {
fstream = new FileInputStream(File1);
BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
while ((strLine = br.readLine()) != null)
System.out.println (strLine);
String str=strLine;
final TextArea txt=new TextArea(str);
layout.addComponents(txt);
//br.close();
} catch (IOException e) {
e.printStackTrace();
}
【问题讨论】: