Package jltk.gui
Class RadioButton
- java.lang.Object
-
- jltk.Component
-
- jltk.gui.Control
-
- jltk.gui.Labeled
-
- jltk.gui.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 Summary
Fields Modifier and Type Field Description protected javafx.scene.control.RadioButton
fxRadioButton
-
Fields inherited from class jltk.gui.Labeled
font, fxLabledComponent
-
Fields inherited from class jltk.Component
fxNode, hasFocus, myWindow, onFocusGained, onFocusLost
-
-
Constructor Summary
Constructors Constructor Description RadioButton(double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates the radio buttonRadioButton(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates the check box
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deselect()
Deselects this radio button.boolean
isSelected()
Returns true, if the radio button is selected.void
select()
Selects this radio button.void
setOnDeselected(String pMethodName)
Sets the name of the method, which will be invoked, if the radio button is selectedvoid
setOnRadiobuttonClicked(String pMethodName)
Sets the name of the method, which will be invoked if the radio button is clicked.void
setOnSelected(String pMethodName)
Sets the name of the method, which will be invoked, if the radio button is selectedvoid
toggle()
Toggles the radio button (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
-
RadioButton
public RadioButton(double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates the radio button- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the radio buttonpHeight
- The height of the radio buttonpText
- 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 coordinatepTop
- The vertical coordinatepWidth
- The width of the radio buttonpHeight
- The height of the radio buttonpWindow
- The window, the radio button should be placedpText
- 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)
-
-