[英]How can i read a text file and diplay it in a netbeans JTextArea?
I'm working in a Netbeans GUI project. 我正在从事Netbeans GUI项目。 All I want to do is to read a text file from a path and display it in a
JTextArea
using Netbeans. 我要做的就是从路径读取文本文件,并使用Netbeans在
JTextArea
显示它。 How can I achieve this? 我该如何实现?
Is there any simple way to do this just using the file path? 有没有简单的方法可以仅使用文件路径来执行此操作?
Lets say i want this be done after a button click.. 可以说我希望在单击按钮后完成此操作。
read Oracles tutorial about How to Use Text Areas 阅读有关如何使用文本区域的 Oracle教程
use JTextArea.read(Reader in, Object desc) throws IOException 使用JTextArea.read(Reader in,Object desc)抛出IOException
请参阅JTextComponent.read(Reader,Object)
以获取几乎一个“单行解决方案”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.