binding - JavaFx Label text = variable -


i have javafx gui in fxml file controller class defined. have 2 text items want in gui, 1 tied variable value not change until user reloads screen, other think needs stringproperty shows running total of column in tableview. because of are, i'm trying use label instead of textfield display control.

i liked sebastian's answer problem here:

displaying changing values in javafx label

however, when try use compile error says:

cannot find symbol    symbol: variable textproperty    location: variable salesnolabel of type label 

i'm not sure i'm doing wrong, start with, label text set in fxml file, in controller have fx:id substituted "mylabel" listed in sebastian's answer:

salesnolabel.textproperty.bind(sn); 

where salesnolabel fx:id of label , sn string variable.

not sure if need see more of code me problem, in advance checking out.

sebastian's answer had syntax error, edited fix it.

you need invoke textproperty() method on label:

salesnolabel.textproperty().bind(sn);     

note addition of parentheses after textproperty identifier invoke method.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -