Hi,
I need to know how to change the icon of a command inside a toolbar.
My code is:
final Toolbar tbMenu = new Toolbar();
fmLista2.setToolBar(tbMenu);
s = UIManager.getInstance().getComponentStyle("Toolbar");
final FontImage iAdicion =
FontImage.createMaterial(FontImage.MATERIAL_CONTROL_POINT, s);
final FontImage iAdicionNo =
FontImage.createMaterial(FontImage.MATERIAL_CONTROL_POINT_DUPLICATE, s);
Command cmdAdicion = new Command("", iAdicion) {
public void actionPerformed(ActionEvent evt) {
if (!activaAdicion) {
txSerial.setEditable(true);
cbCategoria.setEnabled(true);
cbUM.setEnabled(true);
cbImpuesto.setEnabled(true);
btSerial.setEnabled(true);
atArticulo.setGrowLimit(1);
*cmdAdicion.setIcon(iAdicionNo);*
activaAdicion = !activaAdicion;
} else {
*cmdAdicion.setIcon(iAdicion);*
txSerial.setEditable(false);
cbCategoria.setEnabled(false);
cbUM.setEnabled(false);
cbImpuesto.setEnabled(false);
btSerial.setEnabled(false);
atArticulo.setGrowLimit(-1);
activaAdicion = !activaAdicion;
}
fmLista2.revalidate();
}
};
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/af68a7cf-33fb-4c06-b560-410f227a6a65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.