Class FlatToggleButton

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

public class FlatToggleButton extends JToggleButton implements FlatComponentExtension, FlatStyleableComponent
Subclass of JToggleButton that provides easy access to FlatLaf specific client properties.
See Also:
  • Constructor Details

    • FlatToggleButton

      public FlatToggleButton()
  • Method Details

    • getButtonType

      public FlatButton.ButtonType getButtonType()
      Returns type of button.
    • setButtonType

      public void setButtonType(FlatButton.ButtonType buttonType)
      Specifies type of button.
    • isSquareSize

      public boolean isSquareSize()
      Returns whether the button preferred size will be made square (quadratically).
    • setSquareSize

      public void setSquareSize(boolean squareSize)
      Specifies whether the button preferred size will be made square (quadratically).
    • getMinimumWidth

      public int getMinimumWidth()
      Returns minimum width of a component.
    • setMinimumWidth

      public void setMinimumWidth(int minimumWidth)
      Specifies minimum width of a component.
    • getMinimumHeight

      public int getMinimumHeight()
      Returns minimum height of a component.
    • setMinimumHeight

      public void setMinimumHeight(int minimumHeight)
      Specifies minimum height of a component.
    • getOutline

      public Object getOutline()
      Returns the outline color of the component border.
    • setOutline

      public void setOutline(Object outline)
      Specifies the outline color of the component border.

      Allowed Values are:

      • null
      • string "error"
      • string "warning"
      • any color (type Color)
      • an array of two colors (type Color[2]) where the first color is for focused state and the second for unfocused state
    • getTabUnderlinePlacement

      public int getTabUnderlinePlacement()
      Returns placement of underline if toggle button type is FlatButton.ButtonType.tab. If underline placement is not specified, returns SwingConstants.BOTTOM as the default value.
      Since:
      2.3
    • setTabUnderlinePlacement

      public void setTabUnderlinePlacement(int placement)
      Specifies placement of underline if toggle button type is FlatButton.ButtonType.tab.
      Parameters:
      placement - One of the following constants defined in SwingConstants: SwingConstants.TOP, SwingConstants.LEFT, SwingConstants.BOTTOM, or SwingConstants.RIGHT.
      Since:
      2.3
    • getTabUnderlineHeight

      public int getTabUnderlineHeight()
      Returns thickness of underline if toggle button type is FlatButton.ButtonType.tab.
    • setTabUnderlineHeight

      public void setTabUnderlineHeight(int tabUnderlineHeight)
      Specifies thickness of underline if toggle button type is FlatButton.ButtonType.tab.
    • getTabUnderlineColor

      public Color getTabUnderlineColor()
      Returns color of underline if toggle button type is FlatButton.ButtonType.tab.
    • setTabUnderlineColor

      public void setTabUnderlineColor(Color tabUnderlineColor)
      Specifies color of underline if toggle button type is FlatButton.ButtonType.tab.
    • getTabSelectedBackground

      public Color getTabSelectedBackground()
      Returns background color if selected and toggle button type is FlatButton.ButtonType.tab.
    • setTabSelectedBackground

      public void setTabSelectedBackground(Color tabSelectedBackground)
      Specifies background color if selected and toggle button type is FlatButton.ButtonType.tab.