1
나는 jlabel을 가지고 netbeans를 사용하여 양식의 속성에 바인딩했습니다.Java netbeans 바인딩. 바인딩을 새로 고치는 방법 ..?
레이블 텍스트가 바인딩 된 속성이 변경된 경우 바인딩 값을 새로 고치는 방법은 무엇입니까? 작동하지만 나쁜 냄새 this.firePropertyChange ... 난 this.bindingGroup.refresh 또는 같은 someonething 싶습니다
예를 의 jLabel.text이
someValue와를 형성하기 위해 바인딩 레이블 텍스트를 업데이트하는 것 this.refreshprivate 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()?????
}
내가 fireprop과 함께 발견했던 것은 ... 오래된 val과 새로운 val은 무시됩니다. 그것은 나쁜 것이 아닙니다. 런타임에 변경되는 속성의 이름을 알아낼 수있는 방법이 있다면 bind() 메서드를 호출하여 자동으로 모든 것을 수행 할 수 있습니다. – Mark
주 컨테이너에서 firePropertyChange를 세 개의 null args로 호출하면 모든 바인딩이 새로 고쳐집니다. 건배! :디 – Mark