Saturday, January 21, 2012

Simple Calendar for JavaFX 2.0

One of the missing controls in JavaFX 2.0 is a date picker. So I have developed the SimpleCalendar for that purpose. It was also a good practice to learn what you could do with JavaFX. You can download it from http://code.google.com/p/javafx-widgets/downloads/list

The SimpleCalendar is a combination of two components: A popup container for date picking and a button to display the hidden popup container. The container consist of three blocks. The top block displays the month and the year and hosts two arrows to navigate back and forth between months. The center block only displays first letters of the names of the days. The bottom block displays the days of previous, present and next months. The names are retrieved based on default locale. Since the first day of the week is Monday in some locales it is taken into account.



A string bean property (changed to ObjectProperty 28.01.2012) is used to bind the date information. It can be accessible by adding a change listener to the instance of SimpleCalendar.

7 comments:

  1. Hi. This is really nice, but how can i integrate it in a fxml controller?

    Thanks!

    ReplyDelete
    Replies
    1. Hi, You can declare a HBox or some layout tag and add the Date field(Text Field) and simple Calender in initialize() function in your controller class.

      Let me know if you have further questions.

      Delete
    2. Hi, great control. Do you have any intention to add browsing of years in this control? Thanks

      Delete
  2. Thank you Very much you save my life.Sreejesh Ellath JavaFX developer from Dubai

    ReplyDelete
  3. Hello can any one help me to integrate this calander into my FXML project and guide me to customize it ??

    ReplyDelete
  4. Hello Can any one help me to make this calendar responsive ??

    ReplyDelete