0

Currently the font color is same for all the days in the calender, but I want to make weekend in different color.

 Calendar c = Calendar.getInstance(Constants.localeCosnt); 
 int dateValue = c.get(Calendar.DATE);
 setFortnightsOfTheMonth(DateUtils.getFortnightsOfTheMonth(c.getTime(), dateValue));
dur
  • 15,689
  • 25
  • 79
  • 125
Vikash
  • 21
  • 1
  • 1
  • 6

2 Answers2

0

Seems like you want your output to be colored. Use appropriate text output component you are using. You can do something like this

JTextArea txt = new JTextArea();
Font font = new Font("Verdana", Font.BOLD, 12);
txt.setFont(font);
txt.setForeground(Color.BLUE);

Note you will need to use your own text component output. What I'm doing is just showing a path

Juliyanage Silva
  • 2,529
  • 1
  • 21
  • 33
0

Thanks for your answer.

But later I did try it from JSF page using String function and it did work.

<p:column id="hoursWorkedDay1"
    headerText="#{timeAndExpenseManagedController.firstDate}"
    style="background-color:#{timeAndExpenseManagedController.firstDate.substring(0,3)== 'Sat' or
    timeAndExpenseManagedController.firstDate.substring(0,3)== 'Sun'?  
    '#e6f0ff !important' : 'none !important'}">
Vikash
  • 21
  • 1
  • 1
  • 6