Search code examples
codenameone

Button Not Showing Codenameone


I'm trying the charts class, I'm trying to display a return button but it's not displaying. Here's the full code. Please feel free to edit it in case you can help.

I also thought about an easier solution, a toolbar but where can I put it because I tried and it didn't display the button?!

getToolbar().addMaterialCommandToLeftBar("", FontImage.MATERIAL_ARROW_BACK, e-> previous.showBack());

OUTPUT: enter image description here

Here's the code: CODE


Solution

  • Maybe this works

    toolbar=new Toolbar();
    toolbar.setTitle(titleString);
    form.setToolbar(toolbar);
    toolbar.setEnabled(true);
    toolbar.addMaterialCommandToLeftBar("", FontImage.MATERIAL_ARROW_BACK, e-> previous.showBack());
    toolbar.showToolbar();