Hi,
There is already a javafx 8 datepicker library on the forum, but I needed more functionalities, so I wrote my own datepicker library based on javafx 8 datepicker and localdate.
jDatePickerEx:
This library offers more than the datepicker functions and methods. It includes parts of the Javafx "java.time.LocalDate" and also some custom functions that I created for my needs, like the autocorrect dates.
With this library, you can control the date picker, compare the selected date with another, get separately the selected year, month, day of month or add and subtract number of years, months weeks and days to the selected date and event more.
Requirements:
- Javafx 8 minimum
- Scene Builder 2.0 minimum
Events:
One event raised when the date has been changed.
How to use it:
Comments and critics welcomed!
Jmon
There is already a javafx 8 datepicker library on the forum, but I needed more functionalities, so I wrote my own datepicker library based on javafx 8 datepicker and localdate.
jDatePickerEx:
This library offers more than the datepicker functions and methods. It includes parts of the Javafx "java.time.LocalDate" and also some custom functions that I created for my needs, like the autocorrect dates.
With this library, you can control the date picker, compare the selected date with another, get separately the selected year, month, day of month or add and subtract number of years, months weeks and days to the selected date and event more.
Requirements:
- Javafx 8 minimum
- Scene Builder 2.0 minimum
Events:
One event raised when the date has been changed.
B4X:
Sub datePicker_DateChanged
'Your code here.
'DatePicker.GetDate
'DatePicker.GetYear
'DatePicker.IsLeapYear
'DatePicker.IsBefore(2015, 1, 1)
'....
End Sub
How to use it:
- Copy the included jar and xml files to your additional libraries folder
- In SceneBuilder, create a DatePicker node and give it a name.
- Initialise jDatePickerEx with the datepicker node previously created.
Comments and critics welcomed!
Jmon
Library updated : 2015-06-13:
- New methods:
-- SetDateToNull (I don't recommend to use this method because you will get NullPointerExceptions).
Library updated : 2015-01-9:
- New methods:
-- Editable : Get or set the editable state
-- Enabled: Get or set the enabled state
-- Opened: Get or set the opened state
-- Tag: Get or set an object tag linked to this node
-- Visible: Get or set the visible state
Library updated : 2015-01-26 (2):
- Event had wrong number or underscores.
Library updated : 2015-01-26:
- New method : Opened: opens or closes the datepicker pop-up. Also returns if the pop-ip is opened or not.
- You can now scroll the mouse on the edit area of the datepicker to add or substract one day.
Attachments
Last edited: