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
Post a Comment