Code example for JLabel

Methods: setBordersetVisiblesetIcon

0
        } 
 
        int numRequests = spec.getNumRequests(numObjects);
        String msg = null;
        if (useOneChangeset) {
            lblWarning.setVisible(false);
            if (numRequests == 0) {
                msg = trn(
                        "Uploading <strong>{0} object</strong> to <strong>1 changeset</strong>", 
                        "Uploading <strong>{0} objects</strong> to <strong>1 changeset</strong>", 
                        numObjects, numObjects
                ); 
            } else if (numRequests == 1) {
                msg = trn(
                        "Uploading <strong>{0} object</strong> to <strong>1 changeset</strong> using <strong>1 request</strong>", 
                        "Uploading <strong>{0} objects</strong> to <strong>1 changeset</strong> using <strong>1 request</strong>", 
                        numObjects, numObjects
                ); 
            } else if (numRequests > 1){
                msg = tr("Uploading <strong>{0} objects</strong> to <strong>1 changeset</strong> using <strong>{1} requests</strong>", numObjects, numRequests);
            } 
            msg = msg + " (<a href=\"urn:advanced-configuration\">" + tr("advanced configuration") + "</a>)";
        } else { 
            lblWarning.setVisible(true);
            if (numRequests == 0) {
                msg = tr("{0} objects exceed the max. allowed {1} objects in a changeset on the server ''{2}''. Please <a href=\"urn:advanced-configuration\">configure</a> how to proceed with <strong>multiple changesets</strong>",
                        numObjects, maxChunkSize, OsmApi.getOsmApi().getBaseUrl());
            } else if (numRequests > 1){
                msg = tr("Uploading <strong>{0} objects</strong> to <strong>multiple changesets</strong> using <strong>{1} requests</strong>", numObjects, numRequests);
                msg = msg + " (<a href=\"urn:advanced-configuration\">" + tr("advanced configuration") + "</a>)";
            } 
        } 
        return msg;
    } 
 
    protected void build() { 
        jepMessage = new JMultilineLabel("");
        jepMessage.addHyperlinkListener(this);
 
        setLayout(new BorderLayout());
        add(jepMessage, BorderLayout.CENTER);
        lblWarning = new JLabel("");
        lblWarning.setVisible(false);
        lblWarning.setIcon(ImageProvider.get("warning-small.png"));
        lblWarning.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        JPanel pnl = new JPanel(new BorderLayout());
        pnl.add(lblWarning, BorderLayout.NORTH);
        add(pnl, BorderLayout.WEST);
    } 
 
Connect your IDE to all the code out there  Get Codota for Java