convex.gui.components.DropdownMenu Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of convex-gui Show documentation
Show all versions of convex-gui Show documentation
Convex desktop GUI and test applications
package convex.gui.components;
import javax.swing.JButton;
import javax.swing.JPopupMenu;
import convex.gui.utils.Toolkit;
/**
* A dropdown menu that can be used wherever an embedded menu is needed.
*/
@SuppressWarnings("serial")
public class DropdownMenu extends JButton {
private JPopupMenu popupMenu;
public DropdownMenu(JPopupMenu popupMenu) {
super();
this.popupMenu = popupMenu;
this.setIcon(Toolkit.COG);
this.addActionListener(e -> {
popupMenu.show(this, 0, this.getHeight());
});
}
public JPopupMenu getMenu() {
return popupMenu;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy