如何禁用 LWUIT 中的组合框?

发布于 2025-01-01 23:11:20 字数 87 浏览 1 评论 0原文

我在表单中创建了 ComboBox 和 CheckBox。
现在我想做的是,如果我选中 CheckBox 意味着 ComboBox 将被禁用。怎么做呢?

I have created ComboBox and CheckBox in a Form.
Now what I want to do is, if I checked that CheckBox means the ComboBox will be disabled. How to do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寻找一个思念的角度 2025-01-08 23:11:20

当选中 CheckBox 时,您应该设置禁用 ComboBox。例如,当您捕获按下的 FIRE 键时,您必须将此代码放入 actionPerformed 方法中。所以:

  if(checkBox.isSelected()){
       comboBox.setEnabled(false);
    }else{
       comboBox.setEnabled(true);
    }

You should set disable the ComboBox when the CheckBox is checked. You must put this code inside the actionPerformed method, when you capture a FIRE key pressed for example. So:

  if(checkBox.isSelected()){
       comboBox.setEnabled(false);
    }else{
       comboBox.setEnabled(true);
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文