A dropdown menu button is a button which shows a dropdown menu on click. The button will look like one of these:
Browser | Desktop |
---|---|
To create such button, simply use the following snippet:
UIPopupMenuButton button = new UIPopupMenuButton(); button.setImage(UIImage.getImage(IFontAwesome.BARS_SMALL)); UIMenuItem miDelete = new UIMenuItem("Delete", UIImage.getImage(UIImage.REMOVE_SMALL), this, "doDelete"); UIMenuItem miExport = new UIMenuItem("Export", UIImage.getImage(UIImage.EXPORT_SMALL), this, "doExport"); UIPopupMenu popupMenu = new UIPopupMenu(); popupMenu.add(miDelete); popupMenu.add(miExport); button.setPopupMenu(popupMenu);