All Known Subinterfaces:
FrameworkIcons
All Known Implementing Classes:
DefaultFrameworkIcons

public interface Icons
Provides icons for ui components. The icon color follows the 'Button.foreground' color of the current Look and feel. Add icons via add(Ikon...) (Ikon)} and retrieve them via icon(Ikon).
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final PropertyValue<Color>
    The icon color
    Value type: Color
    Default value: UIManager.getColor("Button.foreground")
    static final PropertyValue<Integer>
    The icon size, note that this will affect the size of buttons
    Value type: Integer
    Default value: 16
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(org.kordamp.ikonli.Ikon... ikons)
    Adds the given ikons to this FrameworkIcons instance.
    Disables the dynamic color change listener
    Adds a listener to the ICON_COLOR property value, dynamically changing the color of the icons in this instance.
    icon(org.kordamp.ikonli.Ikon ikon)
    Retrieves the ImageIcon associated with the given ikon from this FrameworkIcons instance.
    static Icons
     
    void
    Sets the icon color
  • Field Details

    • DEFAULT_ICON_SIZE

      static final int DEFAULT_ICON_SIZE
      See Also:
    • ICON_SIZE

      static final PropertyValue<Integer> ICON_SIZE
      The icon size, note that this will affect the size of buttons
      Value type: Integer
      Default value: 16
    • ICON_COLOR

      static final PropertyValue<Color> ICON_COLOR
      The icon color
      Value type: Color
      Default value: UIManager.getColor("Button.foreground")
  • Method Details

    • add

      void add(org.kordamp.ikonli.Ikon... ikons)
      Adds the given ikons to this FrameworkIcons instance. Retrieve an icon via icon(Ikon).
      Parameters:
      ikons - the ikons to add
      Throws:
      IllegalArgumentException - in case an icon has already been associated with any of the given ikons
    • icon

      ImageIcon icon(org.kordamp.ikonli.Ikon ikon)
      Retrieves the ImageIcon associated with the given ikon from this FrameworkIcons instance.
      Parameters:
      ikon - the ikon
      Returns:
      the ImageIcon associated with the given ikon
      Throws:
      IllegalArgumentException - in case no icon has been associated with the given ikon
      See Also:
    • setIconColor

      void setIconColor(Color color)
      Sets the icon color
      Parameters:
      color - the color
    • enableIconColorListener

      Icons enableIconColorListener()
      Adds a listener to the ICON_COLOR property value, dynamically changing the color of the icons in this instance.
      Returns:
      this icons instance
    • disableIconColorListener

      Icons disableIconColorListener()
      Disables the dynamic color change listener
      Returns:
      this icons instance
    • icons

      static Icons icons()
      Returns:
      a new Icons instance