-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
What the text widget should be able to do?
- Display text
- Wrap text if parent is too small: word wrapping and if that is not possible character based wrapping
- Stylized text like bold, italic, colored, underlined
- Have clickable links in the text
- Align the text horizontally
- Allow for vertical alignment, if the text uses more height than necessary like is the case with
JTextPane - Changing the font/text size
- Selectable text to copy it
These are basic requirements that modern UI frameworks satisfy through a text widget. For swing, this is not the case at all, there are many different widgets, none satisfying everything
JLabel(orJBLabel): Does not support wrappingJTextPane: Occupies more height than necessary -> Needs vertical centering/other hacks that I have yet to figure outDslLabel: IntelliJ subclass ofJTextPane, doesn't really work with wrappingJTextArea
The best candidate for an universal widget at the moment is a decently modified JTextPane with an underlying HtmlEditorTextKit, but it suffers from some issues like using too much vertical space (-> text must be aligned or the bug must be fixed) or styles not always applying.
For reference, this might work.
This issue is in parts related to #162.