Class DropDownComponent

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class DropDownComponent extends JPanel
The drop down menu component. Supports drop down popup menu and the main button.
Version:
$Id: DropDownComponent.java 1808023 2017-09-11 12:43:22Z ssteiner $
See Also:
  • Field Details

    • mainButton

      private JButton mainButton
      The main button for this component.
    • enabledDownArrow

      private Icon enabledDownArrow
      The icon for enabled drop down button.
    • disabledDownArrow

      private Icon disabledDownArrow
      The icon for disabled drop down button.
    • popupMenu

      The scrollable pop up menu.
    • isDropDownEnabled

      private boolean isDropDownEnabled
      If drop down menu appears when clicked on dropdown button.
  • Constructor Details

    • DropDownComponent

      public DropDownComponent(JButton mainButton)
      Creates the dropdown menu with the given main button.
      Parameters:
      mainButton - the components main button
  • Method Details

    • getPopupMenu

      Gets the dropdown popup menu.
      Returns:
      ScrollablePopupMenu
    • setEnabled

      public void setEnabled(boolean enable)
      Overrides:
      setEnabled in class JComponent
    • isEnabled

      public boolean isEnabled()
      Overrides:
      isEnabled in class Component
    • updateMainButtonTooltip

      public void updateMainButtonTooltip(String newTooltip)
      Sets new tooltip text to the main button.
      Parameters:
      newTooltip - the new tooltip text