[英]how to read a file (.txt) in a JTextArea without using JFileChooser?
我想知道如何在不使用JFileChooser
情况下读取JTextArea
的文件( .txt )吗? 我想知道是否还有其他方法可以在程序主体上编写代码以在JTextArea`` without using
上显示它JTextArea`` without using
JFileChooser`?
BufferedReader in = new BufferedReader(new FileReader("<Filename>"));
String line;
while((line = in.readLine()) != null)
{
txtArea.append(line);
}
in.close(
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.