Class TieredComboBox

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants

public class TieredComboBox extends JButton
A custom-widget intended to emulate a standard JComboBox, but leveraging a JPopupMenu (which may include sub-menus) for the drop-down component.
See Also:
  • Constructor Details

    • TieredComboBox

      public TieredComboBox()
  • Method Details

    • getMargin

      public Insets getMargin()
      Overrides:
      getMargin in class AbstractButton
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • setEnabled

      public void setEnabled(boolean b)
      Overrides:
      setEnabled in class AbstractButton
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • setMenu

      public void setMenu(JPopupMenu newMenu)
      Defines the JPopupMenu which will be displayed directly under this Component to emulate a JComboBox drop-down
      Parameters:
      newMenu - the (possibly multi-level) menu to display
    • getMenu

      public JPopupMenu getMenu()
      Gets the menu, which has been given to us
      Returns:
      the JPopupMenu which we have been directed to display