Package jltk.gui
Class Button
- java.lang.Object
-
- jltk.Component
-
- jltk.gui.Control
-
- jltk.gui.Labeled
-
- jltk.gui.Button
-
public class Button extends Labeled
The Button class represents a button in a gui. A button can be clicked and you can specify a method which should be invoke, if the button is clicked. events: clicked- Version:
- 17.05.2022
- Author:
- ms
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.control.ButtonfxButton-
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 voidsetOnButtonClicked(String pMethodName)Set the name of the method, which will be invoked, if the button is clicked.-
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
-
Button
public Button(double pLeft, double pTop, double pWidth, double pHeight, String pText)Creates the Button- Parameters:
pLeft- The horizontal coordinatepTop- The vertical coordinatepWidth- The width of the buttonpHeight- The height of the buttonpText- The label of the button
-
Button
public Button(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates the Button- Parameters:
pLeft- The horizontal coordinatepTop- The vertical coordinatepWidth- The width of the buttonpHeight- The height of the buttonpWindow- The window, the button should be placedpText- The label of the button
-
-
Method Detail
-
setOnButtonClicked
public void setOnButtonClicked(String pMethodName)
Set the name of the method, which will be invoked, if the button is clicked.
-
-