I know the methods, but when i use them they throws java.lang.NullPointerException
You get that exception because you haven't initialized the objects. You have create something with "new" in order to use it.
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
@bluerose
I think javaAddict conveyed that same point with his post. Please don't repeat people for the sake of posting (unless you're adding something to the discussion), otherwise, you'll become like adatapost.
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
Where do instantiate the JTextArea? It should be somewhere were is "visible"(not out of scope) form your main. Also if you want it to be displayed you need to attach it to a JPanel, the JPanel to a JFrame and then you need to instantiate the JFrame and set it to be visible. JTextArea will not be displayed no its own
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448