Ignore:
Timestamp:
2016-03-14T23:06:43+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - use JLabel.setLabelFor where applicable + add/update unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java

    r9833 r9996  
    572572            final JTabbedPane tabs = new JTabbedPane();
    573573
    574             tabs.add("Info", buildInfoPanel(s));
    575574            JLabel lblInfo = new JLabel(tr("Info"));
     575            lblInfo.setLabelFor(tabs.add("Info", buildInfoPanel(s)));
    576576            lblInfo.setFont(lblInfo.getFont().deriveFont(Font.PLAIN));
    577577            tabs.setTabComponentAt(0, lblInfo);
     
    583583
    584584            final JPanel pSource = new JPanel(new GridBagLayout());
    585             tabs.addTab("Source", pSource);
    586585            JLabel lblSource = new JLabel(tr("Source"));
     586            lblSource.setLabelFor(tabs.add("Source", pSource));
    587587            lblSource.setFont(lblSource.getFont().deriveFont(Font.PLAIN));
    588588            tabs.setTabComponentAt(3, lblSource);
     
    615615            if (items.isEmpty()) {
    616616                JLabel lblErrors = new JLabel(tr(title));
     617                lblErrors.setLabelFor(pErrors);
    617618                lblErrors.setFont(lblInfo.getFont().deriveFont(Font.PLAIN));
    618619                lblErrors.setEnabled(false);
     
    621622            } else {
    622623                JLabel lblErrors = new JLabel(tr(title), icon, JLabel.HORIZONTAL);
     624                lblErrors.setLabelFor(pErrors);
    623625                tabs.setTabComponentAt(pos, lblErrors);
    624626            }
Note: See TracChangeset for help on using the changeset viewer.