Results 1 to 4 of 4
  1. #1
    nhmllr's Avatar
    nhmllr is offline Member
    Join Date
    Aug 2011
    Posts
    51
    Rep Power
    0

    Default Change Swing "Focus" color from blue to something else

    I'm making a little Swing application, and currently when a JTextField has been disabled ( setEnabled(false) ) the text in the field becomes a very light blue. I would like to change this color from blue to black, but there doesn't seem to be a method to do that like there is for "setForeground()"

    How can this be accomplished?

    Thanks

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,244
    Rep Power
    19

    Default Re: Change Swing "Focus" color from blue to something else

    It does depend on your application's LaF, but you should find this blog post by camickr useful: UIManager Defaults Java Tips Weblog

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,244
    Rep Power
    19

    Default Re: Change Swing "Focus" color from blue to something else

    ... or if that works for you, you could setEditable(false) instead.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    nhmllr's Avatar
    nhmllr is offline Member
    Join Date
    Aug 2011
    Posts
    51
    Rep Power
    0

    Default Re: Change Swing "Focus" color from blue to something else

    Quote Originally Posted by DarrylBurke View Post
    ... or if that works for you, you could setEditable(false) instead.

    db
    Ahahaha yes, this is what I was looking for. I didn't know that method did that.

    Thanks

Similar Threads

  1. Replies: 0
    Last Post: 12-07-2012, 08:29 AM
  2. Change border color from blue to green of JFrame
    By altu57 in forum AWT / Swing
    Replies: 1
    Last Post: 07-10-2010, 04:19 AM
  3. [COLOR="Navy"]execute .bat file in mysql [/COLOR]
    By msankar.ravi in forum Networking
    Replies: 0
    Last Post: 02-24-2010, 04:27 AM
  4. Replies: 1
    Last Post: 01-21-2010, 09:20 AM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 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
  •