[英]Filthy Rich Clients - Problem with propertySetter in ObjectModifier
我正在嘗試從我的JFrame內部使用框架中的Animator類:
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
Animator animator = new Animator(100);
animator.addTarget(new PropertySetter(AnimatedIcon.this, "alpha", 0.0f));
animator.setAcceleration(0.2f);
animator.setDeceleration(0.4f);
animator.start();
}
});
但是結果是我得到以下錯誤:“ ObjectModifier中propertySetter的問題調用setValue:java.lang.NullPointerException
方法的問題”請幫助,我嘗試了很多事情來解決它,但沒有成功。 (AnimatedIcon是一個外部類)
這個怎么樣?
super.mouseClicked(e);
PropertySetter setter = new PropertySetter(AnimatedIcon.this, "alpha", 0.0f));
Animator animator = new Animator(100, setter);
animator.setAcceleration(0.2f);
animator.setDeceleration(0.4f);
animator.start();
謝謝大家,我發現了自己的錯誤:該類未聲明為public,而是默認為。 由於我正在使用使用批注的框架,並且該框架不是來自同一包,因此非公共類不允許從外部使用其方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.