Package jltk.gui

Class 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 Detail

      • fxTextArea

        protected javafx.scene.control.TextArea fxTextArea
    • 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the label
        pHeight - The height of the label
        pText - 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the label
        pHeight - The height of the label
        pText - 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the label
        pHeight - The height of the label
        pWindow - The window, the label should be placed
        pText - 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()