Package jltk.gui

Class RadioButton


  • public class RadioButton
    extends Labeled
    A radio button can be checked or unchecked. If you create a serie of radio buttons and place them in a radio button group, only one radio button ca be selected at a time. events: clicked, selcted, deselected
    Version:
    18.05.2022
    Author:
    ms
    • Field Detail

      • fxRadioButton

        protected javafx.scene.control.RadioButton fxRadioButton
    • Constructor Detail

      • RadioButton

        public RadioButton​(double pLeft,
                           double pTop,
                           double pWidth,
                           double pHeight,
                           String pText)
        Creates the radio button
        Parameters:
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the radio button
        pHeight - The height of the radio button
        pText - The label of the check radio butotn
      • RadioButton

        public RadioButton​(Window pWindow,
                           double pLeft,
                           double pTop,
                           double pWidth,
                           double pHeight,
                           String pText)
        Creates the check box
        Parameters:
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the radio button
        pHeight - The height of the radio button
        pWindow - The window, the radio button should be placed
        pText - The label of the radio button
    • Method Detail

      • setOnSelected

        public void setOnSelected​(String pMethodName)
        Sets the name of the method, which will be invoked, if the radio button is selected. *
      • setOnDeselected

        public void setOnDeselected​(String pMethodName)
        Sets the name of the method, which will be invoked, if the radio button is selected. *
      • setOnRadiobuttonClicked

        public void setOnRadiobuttonClicked​(String pMethodName)
        Sets the name of the method, which will be invoked if the radio button is clicked.
      • isSelected

        public boolean isSelected()
        Returns true, if the radio button is selected.
        Returns:
      • select

        public void select()
        Selects this radio button.
      • deselect

        public void deselect()
        Deselects this radio button.
      • toggle

        public void toggle()
        Toggles the radio button (change the state)