code: public void mouseClicked(MouseEvent evt)
      {
          JLabel button = (JLabel)evt.getSource();
          int iOffsetDay = Integer.parseInt(button.getName());
          iOffsetDay -= targetComponent;
          calendar.setTime(selectedDate);
          int hour = calendar.get(Calendar.HOUR_OF_DAY);
          int minute = calendar.get(Calendar.MINUTE);
          int second = calendar.get(Calendar.SECOND);
          int ms = calendar.get(Calendar.MILLISECOND);
          calendar.setTime(targetDate);
          calendar.add(Calendar.DATE, iOffsetDay);
          if (hour == 0)
              if (minute == 0)
              if (second == 0)
              if (ms == 0)
                  hour = 12;
          calendar.set(Calendar.HOUR_OF_DAY, hour);
          calendar.set(Calendar.MINUTE, minute);
          calendar.set(Calendar.SECOND, second);
          calendar.set(Calendar.MILLISECOND, ms);
          Date date = calendar.getTime();
          JPopupMenu popupMenu = this.getJPopupMenu();
          if (popupMenu != null)
          { // I'm not sure this is the correct code, but here it is!
              Component invoker = popupMenu.getInvoker();
              this.getParent().remove(this);      // Just being careful
              Container container = popupMenu.getParent();
              popupMenu.setVisible(false);
              container.remove(popupMenu);
              if (invoker != null)
                  if (transferFocus)
                      invoker.transferFocus();    // Focus on next component after invoker
          }
          Date oldDate = selectedDate;
          if (selectedDate == targetDate)
              oldDate = null;
          this.firePropertyChange(dateParam, oldDate, date);
      }
docs: Invoked when the mouse button has been clicked (pressed
  and released) on a component.