layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr); Rectangle cr = SwingUtilities.computeUnion(tr.x, tr.y, tr.width, tr.height, ir); return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom);
ir.x = 0; ir.y = 0; ir.width = 0; ir.height = 0; tr.x = 0; tr.y = 0; tr.width = 0; tr.height = 0; vr.x = 0; vr.y = 0; vr.width = Short.MAX_VALUE; vr.height = Short.MAX_VALUE; layoutCL(lab, fm, text, icon, vr, ir, tr); Rectangle cr = SwingUtilities.computeUnion(tr.x, tr.y, tr.width, tr.height, ir); ret = new Dimension(cr.width + insetsX, cr.height + insetsY); } return ret;
  public Dimension getPreferredSize(JComponent c)   {    JLabel lab = (JLabel) c;    Insets insets = lab.getInsets();          FontMetrics fm = lab.getFontMetrics(lab.getFont());    layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr);    Rectangle cr = SwingUtilities.computeUnion(tr.x, tr.y, tr.width, tr.height,                                               ir);    return new Dimension(insets.left + cr.width + insets.right, insets.top        + cr.height + insets.bottom);      }  