Package jltk.gui
Class TextField
- java.lang.Object
-
- jltk.Component
-
- jltk.gui.Control
-
- jltk.gui.TextComponent
-
- jltk.gui.TextField
-
public class TextField extends TextComponent
In a textfield you can put one single line of text. events: confirmed, selectionChanged, contentChanged- Version:
- 23.05.2022
- Author:
- ms
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.control.TextField
fxTextField
-
Fields inherited from class jltk.gui.TextComponent
color, font, fxTextInputControl, newLine, onConfirmed, onContentChanged, onSelectionChanged
-
Fields inherited from class jltk.Component
fxNode, hasFocus, myWindow, onFocusGained, onFocusLost
-
-
Constructor Summary
Constructors Constructor Description TextField(double pLeft, double pTop, double pWidth, double pHeight)
Creates an empty text field on the specified postion on the default window.TextField(double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates an text field on the specified postion on the default window.TextField(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates an text field on the specified postion.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setContent(String pContent)
The text field gets a new String as content-
Methods inherited from class jltk.gui.TextComponent
append, append, append, append, append, append, append, clear, contentIsDouble, contentIsFloat, contentIsInteger, contentIsLongInteger, disableEdit, enableEdit, getContentAsDouble, getContentAsFloat, getContentAsInteger, getContentAsLongInteger, getContentAsString, getFont, getFontSize, getLength, getSelectedText, getSelectionEnd, getSelectionStart, init, isEditable, selectAll, setContent, setContent, setContent, setContent, setContent, setContent, setFont, setFontColor, setFontColor, setFontColor, setFontSize, setFontStyle, setOnConfirmed, setOnContentChanged, setOnSelectionChanged
-
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
-
TextField
public TextField(double pLeft, double pTop, double pWidth, double pHeight)
Creates an empty text field on the specified postion on the default window.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the text fieldpHeight
- The height of the text field
-
TextField
public TextField(double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates an text field on the specified postion on the default window.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the text fieldpHeight
- The height of the text fieldpText
- The text of the text field
-
TextField
public TextField(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates an text field on the specified postion.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the text fieldpHeight
- The height of the text fieldpWindow
- The window, the text field should be placedpText
- The label of the text field
-
-
Method Detail
-
setContent
public void setContent(String pContent)
The text field gets a new String as content- Overrides:
setContent
in classTextComponent
- Parameters:
pText
- The new char for the text component.
-
-