Package jexer

Class TRadioButton

  • All Implemented Interfaces:
    java.lang.Comparable<TWidget>

    public class TRadioButton
    extends TWidget
    TRadioButton implements a selectable radio button. If the user clicks or presses space on this button, it is selected. If the user presses escape on this button, it is unselected.
    • Method Detail

      • onMouseDown

        public void onMouseDown​(TMouseEvent mouse)
        Handle mouse button presses.
        Overrides:
        onMouseDown in class TWidget
        Parameters:
        mouse - mouse button press event
      • onKeypress

        public void onKeypress​(TKeypressEvent keypress)
        Handle keystrokes.
        Overrides:
        onKeypress in class TWidget
        Parameters:
        keypress - keystroke event
      • setWidth

        public void setWidth​(int width)
        Override TWidget's width: we can only set width at construction time.
        Overrides:
        setWidth in class TWidget
        Parameters:
        width - new widget width (ignored)
      • setHeight

        public void setHeight​(int height)
        Override TWidget's height: we can only set height at construction time.
        Overrides:
        setHeight in class TWidget
        Parameters:
        height - new widget height (ignored)
      • draw

        public void draw()
        Draw a radio button with label.
        Overrides:
        draw in class TWidget
      • isSelected

        public boolean isSelected()
        Get RadioButton state, true means selected.
        Returns:
        if true then this is the one button in the group that is selected
      • setSelected

        public void setSelected​(boolean selected)
        Set RadioButton state, true means selected.
        Parameters:
        selected - if true then this is the one button in the group that is selected
      • getId

        public int getId()
        Get ID for this radio button. Buttons start counting at 1 in the RadioGroup.
        Returns:
        the ID
      • getMnemonic

        public MnemonicString getMnemonic()
        Get the mnemonic string for this button.
        Returns:
        mnemonic string