1

I need to change JDateChooser background and foreground color, i changed the color using LaF property window,but nothing happens

enter image description here

Then i also used following code to solve this,

BorrowDateChooser.setBackground(new Color(51,51,51));

but it also not working for me,what can i do for this problem

Sachith Wickramaarachchi
  • 5,546
  • 6
  • 39
  • 68
  • Isn't it related to the issue described in this link ? https://www.thecodingforums.com/threads/jdatechooser-setenabled-color.749473/ – olikaf Dec 20 '16 at 08:38

1 Answers1

0

Use code below to change the jdatechooser background:

       for( Component c : jDateChooser1.getComponents()){
((JComponent)c).setBackground(Color.RED); 

}

  for( Component c : jDateChooser2.getComponents()){
((JComponent)c).setBackground(Color.RED); 

}

the result of example picture: enter image description here