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.

Results 1 to 5 of 5

Thread: println() for JTextArea

  1. #1
    Member
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default println() for JTextArea

    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.


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: println() for JTextArea

    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.

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Location
    Greece
    Posts
    14
    My Mood
    Cheerful
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: println() for JTextArea

    Hi,
    I think you want to type something int the text field or area

    if so you can use the class's contractor

    PHP Code:
    JTextField name  = new JTextField("Everythink you want"); 
    Then you write the same for area but you write JTextArea instead of JTextField

    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

  4. #4
    Junior Member
    Join Date
    Nov 2011
    Location
    Aarhus, Denmark
    Posts
    28
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    JTextArea does indeed have the wanted functionality. Check the API and look for "insert" and "getCaretPosition".

    Sent from my GT-I9000 using Tapatalk

  5. #5
    Member
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: println() for JTextArea

    OOPS. didn't see the typo, *edited*

Similar Threads

  1. [SOLVED] New to JAVA need some help with println multiple variables, I want to add a space
    By lostbit in forum Java Theory & Questions
    Replies: 1
    Last Post: September 24th, 2011, 12:54 PM
  2. How to modify System.out.println()
    By emailkia in forum Java Theory & Questions
    Replies: 6
    Last Post: April 25th, 2011, 12:40 AM
  3. what is System,out,println in System.out.println()?
    By koteshk in forum Java Theory & Questions
    Replies: 2
    Last Post: April 18th, 2011, 12:28 AM
  4. How can i print rows 1 by 1 using System.out.println?
    By noFear in forum Java Theory & Questions
    Replies: 2
    Last Post: August 26th, 2010, 07:35 AM
  5. println class
    By javanub:( in forum Java Theory & Questions
    Replies: 9
    Last Post: May 18th, 2010, 01:18 AM

Tags for this Thread