Package jltk.gui

Class CheckBox


  • public class CheckBox
    extends Labeled
    A checkbox is a small box which, can be checked or unchecked. events: selcted, deselected
    Version:
    18.05.2022
    Author:
    ms
    • Field Detail

      • fxCheckBox

        protected javafx.scene.control.CheckBox fxCheckBox
    • Constructor Detail

      • CheckBox

        public CheckBox​(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 check box
        pHeight - The height of the check box
        pText - The label of the check box
      • CheckBox

        public CheckBox​(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 check box
        pHeight - The height of the check box
        pWindow - The window, the check box should be placed
        pText - The label of the check box
    • Method Detail

      • setOnSelected

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

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

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

        public void select()
        Selects this check box.
      • deselect

        public void deselect()
        Deselects this check box.
      • toggle

        public void toggle()
        Toggles the check box (change the state)