VerifyInputWhenFocusTarget property has no effect

不想你离开。 提交于 2019-12-06 01:43:27

Your calls to setVerifyInputWhenFocusTarget() do have a effect—precisely the effect of determining "whether [the] input verifier for the current focus owner will be called before this component requests focus." [emphasis mine] In particular, establish the following state:

  • Let statusText have its initial value, or restore the initial value by entering a valid value.

  • Let tfFirstNumor tfSecondNum have focus while containing an invalid value.

Then observe that

  • Clicking on ? leaves statusText unchanged, meaning that the focused component's input verifier was not called, as prescribed by

    btnHelp.setVerifyInputWhenFocusTarget(false);
    
  • Clicking on Start sets statusText to reflect an error, meaning that the focused component's input verifier was called, as prescribed by

    btnStart.setVerifyInputWhenFocusTarget(true);
    

Note that both conditions above must be met to see the effect when either button is clicked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!