java - javafx keytyped event not working -
i have javafx editable combobox on key typed , key pressed events not firing while key released event firing. however, if change combobox textfield, works. fxml:
<combobox fx:id="combo_box" editable="true" layoutx="311.0" layouty="194.0" prefheight="26.0" prefwidth="300.0" prompttext="enter name" onkeytyped="#keyaction" />
fxmlcontroller:
public void keyaction(keyevent event) { system.out.println("works"); }
help?
i found works. can use "geteditor" method of combobox, key_typed event works. put code in controller :
this.combo_box.geteditor().setonkeytyped((keyevent e) -> { system.out.println("works"); });
hope helps
Comments
Post a Comment