Changeset 13157 in josm for trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java
- Timestamp:
- 2017-11-25T00:10:36+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java
r11452 r13157 46 46 */ 47 47 public JMultilineLabel(String text, boolean allBold) { 48 this(text, allBold, false); 49 } 50 51 /** 52 * Constructs a normal label but adds HTML tags if not already done so. 53 * Supports both newline characters (<code>\n</code>) as well as the HTML 54 * <code><br></code> to insert new lines. 55 * 56 * Use setMaxWidth to limit the width of the label. 57 * @param text The text to display 58 * @param allBold If {@code true}, makes all text to be displayed in bold 59 * @param focusable indicates whether this label is focusable 60 * @since 13157 61 */ 62 public JMultilineLabel(String text, boolean allBold, boolean focusable) { 48 63 JosmEditorPane.makeJLabelLike(this, allBold); 49 64 String html = text.trim().replaceAll("\n", "<br>"); … … 51 66 html = "<html>" + html + "</html>"; 52 67 } 53 setFocusable(f alse);68 setFocusable(focusable); 54 69 super.setText(html); 55 70 }
Note:
See TracChangeset
for help on using the changeset viewer.