我有一个范围为 0 - 100 的简单刻度。我通过 将它绑定到标签上WindowsBuilder
。我希望文本在刻度上显示数值,然后显示数值%
。我该怎么做呢?
源代码由Windows Builder
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
IObservableValue observeTextLblPercentObserveWidget = WidgetProperties.text().observe(lblPercent);
IObservableValue observeSelectionScaleObserveWidget = WidgetProperties.selection().observe(scale);
bindingContext.bindValue(observeTextLblPercentObserveWidget, observeSelectionScaleObserveWidget, null, null);
//
return bindingContext;
}