Reputation: 39
I'm working in a Netbeans GUI project. All I want to do is to read a text file from a path and display it in a JTextArea
using Netbeans. 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..
Upvotes: 1
Views: 1711
Reputation: 109813
read Oracles tutorial about How to Use Text Areas
use JTextArea.read(Reader in, Object desc) throws IOException
Upvotes: 3
Reputation: 168825
See JTextComponent.read(Reader,Object)
for almost a 'one-line solution'.
Upvotes: 3