Package jltk.gui
Class CheckBox
- java.lang.Object
-
- jltk.Component
-
- jltk.gui.Control
-
- jltk.gui.Labeled
-
- jltk.gui.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 Summary
Fields Modifier and Type Field Description protected javafx.scene.control.CheckBox
fxCheckBox
-
Fields inherited from class jltk.gui.Labeled
font, fxLabledComponent
-
Fields inherited from class jltk.Component
fxNode, hasFocus, myWindow, onFocusGained, onFocusLost
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deselect()
Deselects this check box.boolean
isSelected()
Returns true, if the check box is selected.void
select()
Selects this check box.void
setOnDeselected(String pMethodName)
Sets the name of the method, which will be invoked, if the checkbox is selectedvoid
setOnSelected(String pMethodName)
Sets the name of the method, which will be invoked, if the checkbox is selectedvoid
toggle()
Toggles the check box (change the state)-
Methods inherited from class jltk.gui.Labeled
getFont, getFontSize, getText, init, isUnderline, setFont, setFontColor, setFontColor, setFontColor, setFontSize, setFontStyle, setText, setTextAlignment, setUnderline
-
Methods inherited from class jltk.gui.Control
getColor, getHeight, getWidth, init, setColor, setColor, setColor, setHeight, setSize, setTooltip, setWidth
-
Methods inherited from class jltk.Component
activate, deactivate, focus, getX, getY, hasFocus, hide, init, istActive, isVisible, runMethodByName, setOnFocusGained, setOnFocusLost, setPosition, show, toBack, toFront
-
-
-
-
Constructor Detail
-
CheckBox
public CheckBox(double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates the check box- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the check boxpHeight
- The height of the check boxpText
- 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 coordinatepTop
- The vertical coordinatepWidth
- The width of the check boxpHeight
- The height of the check boxpWindow
- The window, the check box should be placedpText
- 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)
-
-