Package jltk.gui
Class TextArea
- java.lang.Object
-
- jltk.Component
-
- jltk.gui.Control
-
- jltk.gui.TextComponent
-
- jltk.gui.TextArea
-
public class TextArea extends TextComponent
A text area can contain multi-line text events: confirmed, selectionChanged, contentChanged- Version:
- 23.05.2022
- Author:
- ms
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.control.TextArea
fxTextArea
-
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 TextArea(double pLeft, double pTop, double pWidth, double pHeight)
Creates a empty text area on the specified postion.TextArea(double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates a text area on the specified postion.TextArea(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates a text area on the specified position and window.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(Object[] pObject)
The string representation (.toString()) of the given array elements will be set as new content of the textarea.void
disableLineBreak()
Disable automatic line break see: #enableLineBreak()void
enableLineBreak()
Enable automatic line break, so that the content will fit into the width of the text area.String[]
getContentAsStringArray()
Returns the content of the text area as String array.void
newLine()
Appends a new line to the text area.void
setContent(Object[] pObject)
The string representation (.toString()) of the given array elements will be append line by line to the textarea-
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, 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
-
TextArea
public TextArea(double pLeft, double pTop, double pWidth, double pHeight)
Creates a empty text area on the specified postion.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the labelpHeight
- The height of the labelpText
- The text of the label
-
TextArea
public TextArea(double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates a text area on the specified postion.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the labelpHeight
- The height of the labelpText
- The text of the label
-
TextArea
public TextArea(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, String pText)
Creates a text area on the specified position and window.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the labelpHeight
- The height of the labelpWindow
- The window, the label should be placedpText
- The label of the label
-
-
Method Detail
-
setContent
public void setContent(Object[] pObject)
The string representation (.toString()) of the given array elements will be append line by line to the textarea- Parameters:
pText
- The new text for the text component.
-
append
public void append(Object[] pObject)
The string representation (.toString()) of the given array elements will be set as new content of the textarea. Each element in a new line.- Parameters:
pObject
- a one dimensional array
-
getContentAsStringArray
public String[] getContentAsStringArray()
Returns the content of the text area as String array. Each line of the textfeld becomes a element in the array.- Returns:
- The content as String array.
-
newLine
public void newLine()
Appends a new line to the text area.
-
enableLineBreak
public void enableLineBreak()
Enable automatic line break, so that the content will fit into the width of the text area.
-
disableLineBreak
public void disableLineBreak()
Disable automatic line break see: #enableLineBreak()
-
-