Thursday 15 March 2012

java - Javafx - how to change the behavior of upTableColumn -



java - Javafx - how to change the behavior of upTableColumn -

i have tableview 2 columns (tablecolumn).

i delegated 1 of columns (tablecolumn) "on edit commit" (via scene builder).

when write new value 1 of cells column , press come in i'm getting delegated function.

but, if i'm writing value , click mouse on other cell, value not saved (and delegated function not beingness called) (because didn't press enter).

is there way alter behavior ? there way via scene builder or code ?

thanks

the default textfield behavior requires user presses come in key commit edit. can changed extending tablecell class commit editing on focus change, in this tableview tutorial. precisely, @ implementation of editingcell class , usage in example.

basically, needed text field table cell set focus alter listener phone call commitedit(), in next example:

textfield.focusedproperty().addlistener(new changelistener<boolean>(){ @override public void changed(observablevalue<? extends boolean> arg0, boolean arg1, boolean arg2) { if (!arg2) { commitedit(value); } } });

above mentioned illustration shows how set new table cell type table column in java code can set in fxml too.

java javafx

No comments:

Post a Comment