Skip to content

Toolbar throws: IllegalArgumentException #1305

@ghost

Description

Original issue 1306 created by codenameone on 2015-01-24T06:26:11.000Z:

What steps will reproduce the problem?

  1. Add a Toolbar to a Form
  2. Set a back command to the toolbar: tb.addCommandToLeftBar(cmdBack);
  3. Add menu commands to the toolbar: tb.addCommandToOverflowMenu(cmd1);
  4. Run the application in the simulator
  5. Navigate to a form other than the original to which the toobar was added
  6. Select the menu command.

What is the expected output? What do you see instead?
I expect the dialog for the menu command to display items, but instead I get an exception.

What version of the product are you using? On what operating system?
The most current. Windows 7.

Please provide any additional information below.

java.lang.IllegalArgumentException: margin cannot be negative
at com.codename1.ui.plaf.Style.setMargin(Style.java:1623)
at com.codename1.ui.Form.showModal(Form.java:1581)
at com.codename1.ui.Dialog.showModal(Dialog.java:1089)
at com.codename1.ui.Dialog.show(Dialog.java:470)
at com.codename1.ui.Dialog.show(Dialog.java:414)
at com.codename1.ui.Toolbar.showOverflowMenu(Toolbar.java:257)
at com.codename1.ui.Toolbar$ToolbarSideMenu.showMenuDialog(Toolbar.java:541)
at com.codename1.ui.MenuBar.showMenu(MenuBar.java:708)
at com.codename1.ui.Toolbar$ToolbarSideMenu$2.actionPerformed(Toolbar.java:488)
at com.codename1.ui.Form.dispatchCommand(Form.java:1318)
at com.codename1.ui.SideMenuBar$CommandWrapper$ShowWaiter.run(SideMenuBar.java:1554)
at com.codename1.ui.Display.processSerialCalls(Display.java:1110)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1054)
at com.codename1.ui.Display.mainEDTLoop(Display.java:960)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions