java - Change demonstrated texts(strings) of DatePicker in JavaFX -


i'd change demonstrated values of datepicker in javafx.

for example notice below picture: the picture downloaded oracle web site

if want change color , text of datecell of current date, it's seems easy because can below code:

private datepicker datetest = new datepicker(); final callback<datepicker, datecell> daycellfactory = new callback<datepicker, datecell>()         {             public datecell call(final datepicker datepicker)             {                 return new datecell()                 {                     @override                     public void updateitem(localdate item, boolean empty)                     {                         super.updateitem(item, empty);                          if (monthday.from(item).equals(monthday.of(9, 13)))                         {                             settooltip(new tooltip("it's going change"));                             setstyle("-fx-background-color: #ff4444;");                             settext("elyas");                         }                         if (item.equals(localdate.now().plusdays(1)))                         {                             // tomorrow soon.                             setdisable(true);                         }                     }                 };             }         };   datetest.setdaycellfactory(daycellfactory); 

the result of above codes become below picture: enter image description here

so can see changing text , color of datecell ( in case 25th of september) not hard.

but question how can change other part of datepikcer? instance change

"september" "hello"

"sun" "1"

"mon" "2"

"2013" "year container"


Comments