Skip to content

Commit

Permalink
Separators support
Browse files Browse the repository at this point in the history
  • Loading branch information
parubok committed Jul 21, 2023
1 parent 5a2c288 commit 32e7dd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Motivation: Though standard Swing provides a number of options to display multil
read-only `JTextArea`, etc.), none of them IMHO is very convenient and straightforward.
The goal of this component is to provide a multiline label with predictable and easily configurable behavior.

The label implements `javax.swing.Scrollable` interface to support scrolling. By default, up to 20 lines will be
displayed without vertical scroll bar. See `MultilineLabel.setPreferredViewportLineCount`.

The label allows to specify custom separator characters (a space character by default). See `MultilineLabel.setSeparators`.
The label always honors line breaks (e.g. `\n`) if they are present in the text.

The label implements `javax.swing.Scrollable` interface to support scrolling. By default, up to 20 lines will be
displayed without vertical scroll bar. See `MultilineLabel.setPreferredViewportLineCount`.

The `MultilineLabel` class provides a number of static methods to support multiline text painting on components other
than the `MultilineLabel`. For example, `MultilineLabel.calculatePreferredSize` method.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public Set<Character> getSeparators() {
/**
* @param separators Separator characters of this label (case-sensitive).
* When there is not enough width, the label is allowed to automatically break lines at the specified characters.
* By default, space is the only allowed separator.
* By default, the only separator character is space.
* <p>
* The label always honors line breaks (e.g. {@code '\n'}) if they are present in the text.
*
* @see #DEFAULT_SEPARATORS
*/
Expand Down

0 comments on commit 32e7dd4

Please sign in to comment.