Results 1 to 2 of 2
  1. #1
    smith8ar is offline Member
    Join Date
    Oct 2013
    Rep Power

    Default variable selectedTextColor in JTextPane

    I am wondering if Java supports setting the selectedTextColor in a JTextPane to more that just one color. For example, if I select/highlight 2 words, the text color of one word is black and the other is red, I want the text color when highlighted to be it's actual color. But if I were to set the selectedTextColor to red (textPane.setSelectedTextColor(Color.RED)) then both words would be red when selected. Is there any way to have the black word stay black and the red word stay red even when highlighted? Or is this something that Java does not support? Thanks!

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Rep Power

    Default Re: variable selectedTextColor in JTextPane

    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. variable selectedTextColor in JTextPane
    By smith8ar in forum New To Java
    Replies: 0
    Last Post: 10-01-2013, 02:52 PM
  2. Replies: 2
    Last Post: 01-09-2013, 08:10 PM
  3. XML + XSL in JTextpane
    By Stijn_vdd in forum AWT / Swing
    Replies: 0
    Last Post: 03-10-2011, 02:51 PM
  4. JTextPane
    By xXx BlitzK xXx in forum AWT / Swing
    Replies: 1
    Last Post: 12-16-2010, 07:08 AM
  5. JTextpane
    By Mash in forum AWT / Swing
    Replies: 1
    Last Post: 04-15-2010, 06:36 PM

Tags for this Thread

Posting Permissions

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