Ignore:
Timestamp:
2013-11-05T01:53:15+01:00 (10 years ago)
Author:
Don-vip
Message:

Sonar/Findbugs - fix of recent violations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java

    r6340 r6365  
    11// License: GPL. For details, see LICENSE file.
    2 
    32package org.openstreetmap.josm.gui.widgets;
    43
     
    1716 * Note that this won't work if JMultilineLabel is put into a JScrollBox or
    1817 * similar as the bounds will never change. Instead scrollbars will be displayed.
     18 *
     19 * @since 6340
    1920 */
    2021public class JMultilineLabel extends JLabel {
     
    2930     *
    3031     * Use setMaxWidth to limit the width of the label.
    31      * @param text
     32     * @param text The text to display
    3233     */
    33     public JMultilineLabel(String text)
    34     {
     34    public JMultilineLabel(String text) {
    3535        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>";
    3939        }
    40         super.setText(text);
     40        super.setText(html);
    4141    }
    4242
Note: See TracChangeset for help on using the changeset viewer.