Changeset 6365 in josm for trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java
- Timestamp:
- 2013-11-05T01:53:15+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java
r6340 r6365 1 1 // License: GPL. For details, see LICENSE file. 2 3 2 package org.openstreetmap.josm.gui.widgets; 4 3 … … 17 16 * Note that this won't work if JMultilineLabel is put into a JScrollBox or 18 17 * similar as the bounds will never change. Instead scrollbars will be displayed. 18 * 19 * @since 6340 19 20 */ 20 21 public class JMultilineLabel extends JLabel { … … 29 30 * 30 31 * Use setMaxWidth to limit the width of the label. 31 * @param text 32 * @param text The text to display 32 33 */ 33 public JMultilineLabel(String text) 34 { 34 public JMultilineLabel(String text) { 35 35 super(); 36 text= text.trim().replaceAll("\n", "<br>");37 if (!text.startsWith("<html>")) {38 text = "<html>" + text+ "</html>";36 String html = text.trim().replaceAll("\n", "<br>"); 37 if (!html.startsWith("<html>")) { 38 html = "<html>" + html + "</html>"; 39 39 } 40 super.setText( text);40 super.setText(html); 41 41 } 42 42
Note:
See TracChangeset
for help on using the changeset viewer.