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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -