Class MultiLinePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MultiLinePanel extends JPanel
Multiline text editor with "OK" and "CANCEL" buttons. It's possible to set a maximum number of characters. The characters left count is then displaying and updated when entering new text. If the text is longer than the maximum, the "OK" button is disabled, but the text editor is still active to allow deleting the exceeding text or modifying existing. Provided by the broldev.core.swing project.
Since:
1.0 (Dec 26, 2008), broldev.core.swing 0.0.1-SNAPSHOT dependency
Version:
1.0 (Dec 26, 2008)
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Constructor Details

    • MultiLinePanel

      public MultiLinePanel()
      Builds an instance without text and no limit
    • MultiLinePanel

      public MultiLinePanel(String text, int maxStringLength)
      Builds an instance with a predefined text and a length limit.
      Parameters:
      text - value to display into the editor
      maxStringLength - maximum length allowed (0 means no limit)
  • Method Details

    • getText

      public String getText()
      Returns the edited and validated text. If "OK" button clicked, this is the edited text, but if "CANCEL" button is clicked the returned text is the initial text without any modification.
      Returns:
      the edited text