2017-09-12 14 views
1

Button에서 사용자가 여러 번 클릭하면 ToastBar - ToastBar이 표시되고 NullPointerException이 표시됩니다.코드 명 1 - ToastBar NullPointerException

스택 :

java.lang.NullPointerException 
    (Code 1) at com.codename1.components.ToastBar.updateStatus(ToastBar.java:602) 
    at com.codename1.components.ToastBar.access$300(ToastBar.java:84) 
    at com.codename1.components.ToastBar$2.run(ToastBar.java:638) 
    at com.codename1.ui.Display.processSerialCalls(Display.java:1101) 
    at com.codename1.ui.Display.edtLoopImpl(Display.java:1045) 
    at com.codename1.ui.Display.invokeAndBlock(Display.java:1154) 
    at com.codename1.ui.Display.invokeAndBlock(Display.java:1191) 
    at com.codename1.ui.AnimationManager.addAnimationAndBlock(AnimationManager.java:105) 
    at com.codename1.ui.ComponentSelector.animateUnlayoutAndWait(ComponentSelector.java:3584) 
    at com.codename1.ui.ComponentSelector.slideUpAndWait(ComponentSelector.java:1036) 
    at com.codename1.components.ToastBar.setVisible(ToastBar.java:787) 
    at com.codename1.components.ToastBar.updateStatus(ToastBar.java:502) 
    at com.codename1.components.ToastBar.access$300(ToastBar.java:84) 
    at com.codename1.components.ToastBar$2.run(ToastBar.java:638) 
    at com.codename1.ui.Display.processSerialCalls(Display.java:1101) 
    at com.codename1.ui.Display.edtLoopImpl(Display.java:1045) 
    at com.codename1.ui.Display.invokeAndBlock(Display.java:1154) 
    at com.codename1.ui.Display.invokeAndBlock(Display.java:1191) 
    at com.codename1.ui.AnimationManager.addAnimationAndBlock(AnimationManager.java:105) 
    at com.codename1.ui.Container.replaceComponents(Container.java:869) 
    at com.codename1.ui.Container.replaceAndWait(Container.java:744) 
    at com.codename1.components.ToastBar.updateStatus(ToastBar.java:602) 
    at com.codename1.components.ToastBar.access$300(ToastBar.java:84) 
    at com.codename1.components.ToastBar$2.run(ToastBar.java:638) 
    at com.codename1.ui.Display.processSerialCalls(Display.java:1101) 
    at com.codename1.ui.Display.edtLoopImpl(Display.java:1045) 
    at com.codename1.ui.Display.invokeAndBlock(Display.java:1154) 
    at com.codename1.ui.Display.invokeAndBlock(Display.java:1191) 
    at com.codename1.ui.AnimationManager.addAnimationAndBlock(AnimationManager.java:105) 
    at com.codename1.ui.Container.replaceComponents(Container.java:869) 
    at com.codename1.ui.Container.replaceAndWait(Container.java:744) 
    at com.codename1.components.ToastBar.updateStatus(ToastBar.java:602) 
    at com.codename1.components.ToastBar.access$300(ToastBar.java:84) 
    at com.codename1.components.ToastBar$Status.show(ToastBar.java:325) 
    at com.codename1.components.ToastBar.showMessage(ToastBar.java:820) 
    at com.codename1.components.ToastBar.showMessage(ToastBar.java:830) 
    at com.codename1.components.ToastBar.showErrorMessage(ToastBar.java:858) 
    (Code 2) at com.somesite.someapp.somepackage.DigitRoller.copyToClipboard(DigitRoller.java:122) 

(코드 1) : ToastBar.java 라인 602

c.label.getParent().replaceAndWait(c.label, newLabel, CommonTransitions.createCover(CommonTransitions.SLIDE_VERTICAL, true, 300)); 

(코드 2) : DigitRoller.java

protected void copyToClipboard() { 
     Clipboard.copyString(sToken); 
     ToastBar.showErrorMessage("Copied " + sToken, 1000); 
    } 

copyToClipboard() 17,451,515,이 ActionListener에 의해 호출됩니다

btnCopy.addActionListener((e)-> { 
      this.copyToClipboard(); 
     }); 

Dialog에서 응용 프로그램 동결을 Exception 세부 사항을 표시하거나 자신의 결정에 의해 애니메이션을 중지 한 후. 매우 간단하게 응용 프로그램을 중단시킬 수 있습니다.

답변

1

이것은 버그 인 것 같습니다. here에 대한 잠재적 인 해결 방법을 추가했습니다.