ComboBox vs PopupMenu. Why choose one over the other?

As far as I can tell …


  • Easy to add items to list all at once with a StringArray
  • I can set the Selection easily using “setSelectedId”
  • I can modify it’s behavior with a Lamda (onChange)


  • Ability to add Submenu’s. (You can do this with CombBox’s, but with extra steps)
  • You can assign call backs to each item
  • You can change the item selection on the fly by overriding mouseDown

With the exception of needing Submenu’s, I don’t see a reason to use popupmenus.

I don’t want to miss out on the good stuff just because my own needs are limited. Why prefer one over the other? I’d like to expand my knowledge.

The ComboBox has a PopupMenu, so it is not a question of either or…

You can add sub menus to a ComboBox by accessing the underlying PopupMenu calling getRootMenu()


For me, the decision usually comes down to: do I need the selection to show in the button after closing the menu? If so, I use a ComboBox. If not, I use a PopupMenu launched by a Button.

1 Like

Thanks for that.

You just answered the question I was about to ask. I often find that while examples are instructive, they don’t always guide you through other common usage that would be very useful to know.

Thanks, I guess I was wondering if one could be used separately from the other and why one might do that.

I’ve noticed that the “addItem” method call has a different parameter list. I’ll go look for some github samples. I might strike gold there.