如何通过右侧菜单上的代码单击命令?

问题描述 投票:0回答:1

我在表单的右侧菜单中添加了一个命令。 我想通过代码单击命令,但

pointerPressed()
用于组件,
pressed()
用于按钮。

命令不是组件。如何通过代码点击命令?

codenameone
1个回答
0
投票

其实有一个按钮,我们只是为你做的。用途:

Button btn = toolbar.findCommandComponent(cmd);

然后,您可以使用事件并自定义

Button
的外观,就像使用任何
Button
一样。

© www.soinside.com 2019 - 2024. All rights reserved.