Results 1 to 4 of 4

Thread: Client Property

  1. #1
    han003 is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default Client Property

    Hi!

    I'm trying to change the color of a JCheckBox by using
    Java Code:
    box.putClientProperty("CheckBox.foreground", new Color(255,0,0));
    But nothing happens:confused:

  2. #2
    snotmare is offline Member
    Join Date
    Apr 2011
    Posts
    34
    Rep Power
    0

    Default

    I've never set the foreground color that way, so I can't say for sure, but you might need to invalidate the component.

  3. #3
    han003 is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default

    It's somehow related to this: Nimbus Defaults (The Java™ Tutorials > Creating a GUI With JFC/Swing > Modifying the Look and Feel)

    But I have no idea of how to use it:(

  4. #4
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    4

    Default

    How about:
    Java Code:
    checkBox.setForeground(new Color(255,0,0));
    or
    checkBox.setBackground(new Color(255,0,0));

Similar Threads

  1. XML property
    By Abder-Rahman in forum XML
    Replies: 1
    Last Post: 09-27-2009, 08:10 PM
  2. Replies: 0
    Last Post: 06-25-2009, 06:28 AM
  3. Replies: 1
    Last Post: 10-05-2008, 04:12 PM
  4. File Property
    By Juggler in forum New To Java
    Replies: 0
    Last Post: 08-10-2008, 08:23 AM
  5. Identify Client in Socket Client Server Application
    By masadjie in forum Networking
    Replies: 1
    Last Post: 12-20-2007, 10:18 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
  •