Wednesday 28 August 2013

How to make a table cell be edited on KeyPressed in JavaFx2.2



public void startEdit() {
super.startEdit();
createTextField();
setText(null);
setGraphic(textField);

/**
* put focus on the textfield so user can directly typed on it
*/
Runnable r = new Runnable() {
@Override
public void run() {
getGraphic().requestFocus();
}
};
Platform.runLater(r);

}

No comments:

Post a Comment