private void setPreferredLabelSize() {
    Calendar c = Calendar.getInstance(zone, locale);
    c.setTime(getDate());

    JLabel l = new JLabel();
    l.setFont(selectedDateLabel.getFont());

    int maxWidth = Integer.MIN_VALUE;
    for (int i = 0; i <= c.getActualMaximum(Calendar.MONTH); i++) {
      c.set(Calendar.MONTH, i);
      String text = format.format(c.getTime());
      l.setText(text);
      int w = l.getPreferredSize().width;
      if (w > maxWidth)
        maxWidth = w;
    }
    Dimension d = l.getPreferredSize();
    d.width = maxWidth + 10;
    selectedDateLabel.setMinimumSize(d);
    selectedDateLabel.setPreferredSize(d);
    this.revalidate();
  }
private void setPreferredLabelSize()