【问题标题】:Prevent last component of LWUIT form from losing focus when down arrow key is pressed当按下向下箭头键时,防止 LWUIT 表单的最后一个组件失去焦点
【发布时间】:2012-03-14 07:31:22
【问题描述】:

我有一个 lwuit Form,我添加了一个 ContainerContainer 有一个TextArea,一些RadioButtons,最后是另一个Container,其中有一些Buttons

1)TextArea
2)RadioButtons
3) 另一个Container 和一些Buttons

现在,如果焦点位于 Form 上的最后一个 Container 并且我按下“向下箭头键”,焦点将跳转到第一个组件 TextArea

同样,如果焦点位于Form TextArea 上的第一个Container 上并且我按下“向上箭头键”,焦点将跳转到Form 的最后一个组件。

这很烦人。如何防止这种情况发生?

因此,如果焦点位于 Form 中的第一个 Container TextArea...即使按下“向上箭头”键,我也希望焦点保持在 TextArea 上。

【问题讨论】:

    标签: java-me lwuit lwuit-form lwuit-textarea lwuit-container


    【解决方案1】:

    您可以使用Form 的方法setCyclicFocus(boolean cyclicFocus) 解决该问题。只需将此值设置为false。所以,使用Form.setCyclicFocus(false)

    【讨论】:

    • 是的,这是我一直在寻找的东西,而且效果很好。谢谢!
    猜你喜欢
    • 2022-12-17
    • 2012-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-27
    • 1970-01-01
    • 2012-07-17
    相关资源
    最近更新 更多