if (hasBorder) lbl.setBorder(BorderFactory.createEtchedBorder());
if (hasBorder) { CompoundBorder cb = new CompoundBorder(BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(0,5,0,5)); lbl.setBorder(cb); }
    JLabel newLegendLabel(String label, Color color, boolean hasBorder) {        JLabel lbl = new JLabel(label);        lbl.setOpaque(true);        lbl.setBackground(color);        if (hasBorder)            lbl.setBorder(BorderFactory.createEtchedBorder());        return lbl;    }