Class MultilineToggleButton

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MultilineToggleButton extends JPanel
A toggle button (JCheckBox or JRadioButton) that can wrap its label to extend to multiple lines. Use CHECKBOX_TYPE or RADIOBUTTON_TYPE to specify the type of toggle button to create.
Author:
Bao Trang
See Also:
  • Field Details

    • CHECKBOX_TYPE

      public static int CHECKBOX_TYPE
    • RADIOBUTTON_TYPE

      public static int RADIOBUTTON_TYPE
  • Constructor Details

    • MultilineToggleButton

      public MultilineToggleButton(int type, String labelTxt)
      constructor.
      Parameters:
      type - the type of toggle button to create
      labelTxt - the label
  • Method Details

    • setTopAlignment

      public void setTopAlignment()
    • setCenterAlignment

      public void setCenterAlignment()
    • getToggleButton

      public JToggleButton getToggleButton()
      get the toggle button
      Returns:
      toggle button
    • setVisible

      public void setVisible(boolean b)
      Overrides:
      setVisible in class JComponent
    • setEnabled

      public void setEnabled(boolean b)
      Overrides:
      setEnabled in class JComponent
    • main

      public static void main(String[] args)