How to put only Month and Year in Datapicker (Javafx)

Asked

Viewed 128 times

2

By default (by javafx Scene Bilder) comes the datapicker month, day and year. I would like to know how to take the day, and leave only month and year. If you can, thanks!

  • Hello Leonardo, sorry to resuscitate the question, but it has not become clear to me exactly what you want. The idea is not to display the days in the component or just to discard the day when getting the date chosen by the user?

1 answer

3

Take a look at this article. The part that configures the format you want is:

birthdayDatePicker.setDateFormat(new SimpleDateFormat("yyyy-MM-dd"));`

Browser other questions tagged

You are not signed in. Login or sign up in order to post.