'Work/JAVA'에 해당되는 글 1건

  1. 2018.06.22 When JavaFX TextField is not update
Work/JAVA2018. 6. 22. 10:29

만약 JavaFX의 TextField가 업데이트가 안 되면, 임시조치로. TextField 하나 생성하고.

두 개를 바인딩 한 다음 새로 만든 TextField에 값을 쓰면 자동으로 연동된다. 


@FXML private TextField txt_Maker;  // <- what you want to update (destination)


TextField make_Name = new TextField(); // 1. make a new TextField (interface)


public void initialize(URL location, ResourceBundle resources) {


txt_Maker.textProperty().bindBidirectional(make_Name.textProperty()); // 2. bind two textfield


}


private void handle_btn_Load(ActionEvent event) {


make_Name.setText("TEST"); // 3. Write the text to interface textfield. 


}



Posted by Astas