【发布时间】:2010-02-02 12:16:28
【问题描述】:
我有一个 jlabel 并使用 netbeans 将它绑定到表单上的一个属性。
问题是当标签文本绑定到的属性发生更改时,我如何刷新绑定值。 this.firePropertyChange 有效,但闻起来很糟糕......我想要像 this.bindingGroup.refresh 或 this.refresh 这样的东西来更新标签文本
例如 jLabel.text 必然会形成 someValue
private someClass someThing;
public String getSomeValue(){
return someThing.getSomeThing();
}
//when someMethof is fired the jlabel should update its text value
public void someMethod(){
someThing = someThingElse;
bindingGroup.refresh()?????
}
【问题讨论】:
标签: java netbeans binding jlabel