2016-03-18 17 views

cevap

1

Çözüm

Sen DatePicker editörü textProperty dinlemek (veya ona bağlamak) olabilir. Burada, tarih seçicinin editöründe hangi metnin yer aldığına bakılmaksızın, bir dinleyicinin kullanıldığı bir örnek verilmiştir.

Label typedData = new Label(); 
picker.getEditor().textProperty().addListener((observable, oldValue, newValue) -> { 
    typedData.setText(newValue); 
}); 

Numune Uygulama

xyzzy

+0

Çok teşekkürler iş gibi görünüyor

import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class PickingDates extends Application { @Override public void start(final Stage stage) throws Exception { DatePicker picker = new DatePicker(); Label typedData = new Label(); picker.getEditor().textProperty().addListener((observable, oldValue, newValue) -> { typedData.setText(newValue); }); Button button = new Button("Button"); final VBox layout = new VBox(10, typedData, picker, button); layout.setPadding(new Insets(10)); Scene scene = new Scene(layout); stage.setScene(scene); stage.show(); } public static void main(String[] args) { launch(args); } } 
: D –

İlgili konular