Button Not Showing Codenameone

Viewed 47

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

2 Answers

Try this:

getToolbar().setBackCommand("", e-> previous.showBack());

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();
Related