Java examples for JavaFX:Date Picker
set Date Format to JavaFX Table Column
//package com.java2s; import java.text.DateFormat; import java.util.Date; import javafx.scene.control.TableCell; import javafx.scene.control.TableColumn; public class Main { public static void setDateFormatColumn(TableColumn dateColumn, int dateFormat) { DateFormat format = DateFormat.getDateInstance(dateFormat); dateColumn.setCellFactory(myDateTableCell -> { return new TableCell<Object, Date>() { @Override//from w w w . ja va 2 s . c o m protected void updateItem(Date date, boolean dateIsEmpty) { super.updateItem(date, dateIsEmpty); if (date == null || dateIsEmpty) { setText(null); } else { setText(format.format(date)); } } }; }); } }