java - javafx Bindings: Text bind to two properties -
i want bind text property of text node 2 properties this:
text income = new text(); income.textproperty().bind(bindings.concat(available.income.asstring()).concat(" income ").concat(now.getvalue().getmonth().tostring())); 
now, when available.income changes, text node reflect update, when 'now' changes nothing happens;
public static simpleintegerproperty income = new simpleintegerproperty private objectproperty<yearmonth> = new simpleobjectproperty<yearmonth>(yearmonth.now()); how can solve this, thanks
you can do
income.textproperty().bind(bindings.createstringbinding(() -> available.income.get() + " income " + now.getvalue().getmonth(), available.income, now));
Comments
Post a Comment