java复选框没被选择,在CodenameOne中,为什么没有选中复选框但显示为选中状态?...

我有一个奇怪的问题 - 不确定是否存在编码错误或CN1中的错误 .

基本上我创建了一行CheckBox对象并将它们放在一个X-Scrollable的容器中 . 如果我单击一个未选择的项目并拖动,直到“弹性”效果将其拉回,它似乎被选中,但代码不会将其记录为选中 .

请注意,在控制台输出中,单词“selected”在选择字段时大写,在取消选择时小写 . 焦点相同(我将焦点添加到输出以确定setFocusable()是否按预期工作,因此焦点不应归咎于选择错误) .

这是Checkbox创建代码:

cb = new CheckBox(getCacheableImageMaxHeight(mod.getIconFile(),moduleImageHeight));

cb.setName(mod.getModuleID());

cb.setToggle(true);

cb.setUIID("ModuleButton");

cb.setFocusable(false);

cb.setScrollVisible(false);

cb.setTextPosition(Component.BOTTOM);

cb.setCloudDestinationProperty(cb.getName());

//actionlistener added for debugging only

final CheckBox cbFinal = cb;

final String modName = mod.getDisplayName();

cb.addActionListener(new ActionListener() {

@Override

public void actionPerformed(ActionEvent evt) {

System.out.println(modName+", "+(cbFinal.isSelected()?"SELECTED":"selected") + ", " + (cbFinal.hasFocus()?"FOCUS":"focus"));

}

});

c.addComponent(cb);

UPDATE: I've realized there are two "states" at war here: toggleButtons(我现在意识到它们不仅仅是CheckBoxes,因为我在拖动操作期间设置"setToggle(true)) are getting stuck in the "按下" state as they are dragged and released with the "被按下" and "被选中" states have the same appearance so that means my users think they have selected something when it's just stuck being "

这是我做的更多调试 .

YetVA.png

第一个按钮是按下,但未选中(错误) .

第二个按钮被正常选中而没有显示错误 .

第三个按钮很有趣,因为我选择它,然后拖动并释放它以使其被选中并按下!

所以问题变为: Is there an open bug for this situation already (Pressed state gets stuck on after button is released) and if so, is there a fix coming or a workaround for now?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值