本文整理匯總了Java中javafx.scene.control.DatePicker.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java DatePicker.getValue方法的具體用法?Java DatePicker.getValue怎麽用?Java DatePicker.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.control.DatePicker
的用法示例。
在下文中一共展示了DatePicker.getValue方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: focusGained
import javafx.scene.control.DatePicker; //導入方法依賴的package包/類
@Override public void focusGained(RFXComponent prev) {
DatePicker datePicker = (DatePicker) node;
LocalDate value = datePicker.getValue();
if (value == null && datePicker.isEditable()) {
prevDate = datePicker.getEditor().getText();
} else {
prevDate = getDatePickerText(datePicker, value);
}
}
示例2: focusLost
import javafx.scene.control.DatePicker; //導入方法依賴的package包/類
@Override public void focusLost(RFXComponent next) {
DatePicker datePicker = (DatePicker) node;
LocalDate value = datePicker.getValue();
String currentDate;
if (value == null && datePicker.isEditable()) {
currentDate = datePicker.getEditor().getText();
} else {
currentDate = getDatePickerText(datePicker, value);
}
if (!currentDate.equals(prevDate))
recorder.recordSelect(this, currentDate);
}
示例3: updateDatePicker
import javafx.scene.control.DatePicker; //導入方法依賴的package包/類
private void updateDatePicker(DatePicker datePicker, LocalDateTime newValue) {
if (newValue == null) {
if (datePicker.getValue() != null)
datePicker.setValue(null);
return;
}
LocalDate current = datePicker.getValue();
if (current != null && current.equals(newValue.toLocalDate()))
return;
datePicker.setValue(newValue.toLocalDate());
}
示例4: datePicker
import javafx.scene.control.DatePicker; //導入方法依賴的package包/類
public static void datePicker(DatePicker campo) throws Erro{
if(campo.getValue() == null){
Janela.showTooltip(Status.ADVERTENCIA, idioma.getMensagem("campo_nao_informado"), campo, Duracao.CURTA);
campo.requestFocus();
throw new Erro();
}
}
示例5: getDate
import javafx.scene.control.DatePicker; //導入方法依賴的package包/類
private Optional<ZonedDateTime> getDate(DatePicker datePicker) {
return datePicker.getValue() != null
? Optional.of(ZonedDateTime.of(datePicker.getValue().atTime(0, 0), ZoneId.of("UTC")))
: Optional.empty();
}