Is there a println() equivalent for a JTextArea? Or perhaps a method that adds specified text to the current caret location?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Is there a println() equivalent for a JTextArea? Or perhaps a method that adds specified text to the current caret location?
Last edited by KILL3RTACO; November 28th, 2011 at 06:14 PM.
1. Your title and description of problem doesn't match.
2. What do you need to do? If you want to print the value of any component. Get it value by using .getText() function.
Hi,
I think you want to type something int the text field or area
if so you can use the class's contractor
Then you write the same for area but you write JTextArea instead of JTextFieldPHP Code:
JTextField name = new JTextField("Everythink you want");
if not search at Java Platform SE 6 and I am pretty sure you will find what you want it has all Java packages classes and methods (at least the published by Oracle) there would be the method you want.
I hope i helped you if not post you question with a more understandable way
Ps: Sorry for my grammatical or syntax mistakes but I am from greece
JTextArea does indeed have the wanted functionality. Check the API and look for "insert" and "getCaretPosition".
Sent from my GT-I9000 using Tapatalk
OOPS. didn't see the typo, *edited*