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