Results 1 to 3 of 3
  1. #1
    bigvanilla is offline Member
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default Different text color in JTextArea

    Hi everyone.

    I am testing a application where I have a JTextArea. In that text area I want some text with black text and another text with red color(for error messages).

    But when I change color at the text area it change the whole area(all text) and not the color I just set before I append the text.

    In my method I check if it is a normal text or a error text and then I set the color for text area and then I append, next time I want append text to the area i set a new color and then append the text.

    Is there any thing I can do to have text with different color in that text area?

    I have search but dosent found any solution for this.

    Regards Patrik

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  3. #3
    bigvanilla is offline Member
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default

    Thanks for that super fast answer, I will test this :-)

    // Patrik

Similar Threads

  1. Changing text color in SWT
    By ourimaler in forum SWT / JFace
    Replies: 1
    Last Post: 06-02-2010, 02:08 PM
  2. text color
    By jpito in forum Advanced Java
    Replies: 1
    Last Post: 11-18-2009, 01:33 AM
  3. Need Help showing text in JTextArea
    By GuyFawkes in forum AWT / Swing
    Replies: 3
    Last Post: 05-05-2008, 10:19 AM
  4. JTextArea - text align
    By bradder in forum AWT / Swing
    Replies: 1
    Last Post: 11-29-2007, 08:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •