Good day! It is necessary to make the table as in the screenshot, tell me how to do it correctly and easier, the datepicker, as I understood it in this situation will not help. Already wrote a combobox which allows you to select a month, via enum, and the number of days in the month is indicated there, but then the question arises how to correctly display the days of the week.

Ps. There is a feeling that you can somehow solve this problem more easily, thanks in advance

PS. It turned out to implement, I spread the code, can someone come in handy. If you have thoughts on how to improve, always happy to hear.

public class EnMonth { public enum Month { JANUARY(0, 31, "Январь" ), FEBRUARY(1, 28, "Февраль" ), MARCH(2, 31, "Март" ), APRIL(3, 30, "Апрель" ), MAY(4, 31, "Май" ), JUNE(5, 30, "Июнь" ), JULY(6, 31, "Июль" ), AUGUST(7, 31, "Август" ), SEPTEMBER(8, 30, "Сентябрь" ), OCTOBER(9, 31, "Октябрь" ), NOVEMBER(10, 30, "Ноябрь" ), DECEMBER(11, 31, "Декабрь" ); private final int _days; private final String _name; private final int _nomberOfMonth; public int get_days() {return _days;} public int get_nomberOfMonth() {return _nomberOfMonth;} public String get_name() {return _name;} Month(int nomberOfMonth, int days, String name) { _nomberOfMonth = nomberOfMonth; _days = days; _name = name; } @Override public String toString() { return get_name( ); } } public static ObservableList<String> dOf (Month month){ ObservableList<String> list = FXCollections.observableArrayList(); Calendar calendar = Calendar.getInstance(); calendar.clear(); calendar.set(2017, month._nomberOfMonth, 0); SimpleDateFormat d = new SimpleDateFormat( "dd.EE" ); for(int i = 0; i < month._days; i++){ System.out.println(d.format(calendar.getTime())); calendar.add(Calendar.DAY_OF_WEEK, 1); //Прибавляем сутки list.add( d.format( calendar.getTime() ) );}; return list; }} 

enter image description here

  • Try SimpleDateFormat - Serodv
  • Do you need to withdraw only one week? or do you want the whole month? - Mikhail Vaysman
  • The whole month, a week just cited for example. - Alex
  • add your version to the question - Mikhail Vaysman

0