Results 1 to 2 of 2

Thread: text color

  1. #1
    jpito is offline Member
    Join Date
    Nov 2009
    Rep Power

    Default text color

    hello, i would like to know how is it possible to change the color of a text on a JTextPane.
    its like i receive a text into the pane and i would like to change for example all "hello" words background or foreground color.

    ty for your time :D

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Rep Power


    Sure. Read the JTextPane API and you will find a link to the Swing tutorial on "Using Text Components" which provides a working example.

Similar Threads

  1. color text in standalone???
    By hung_tyh in forum New To Java
    Replies: 6
    Last Post: 12-24-2008, 05:29 PM
  2. Text color in disabled componentes
    By saul_2110 in forum AWT / Swing
    Replies: 8
    Last Post: 12-13-2008, 06:37 AM
  3. Replies: 6
    Last Post: 10-17-2008, 06:11 PM
  4. Replies: 0
    Last Post: 06-25-2008, 10:33 AM
  5. Changing the color of text
    By Lang in forum New To Java
    Replies: 1
    Last Post: 11-04-2007, 10:51 AM

Posting Permissions

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