public void openPopup(){
  if (settings == null) {
    return;
  }
  if (!isEnabled()) {
    return;
  }
  if (!dateTextField.hasFocus()) {
    dateTextField.requestFocusInWindow();
  }
  LocalDate selectedDateForCalendar=lastValidDate;
  DatePicker thisDatePicker=this;
  calendarPanel=new CalendarPanel(thisDatePicker);
  if (selectedDateForCalendar != null) {
    calendarPanel.setSelectedDate(selectedDateForCalendar);
  }
  popup=new CustomPopup(calendarPanel,SwingUtilities.getWindowAncestor(this),this,settings.getBorderCalendarPopup());
  int defaultX=toggleCalendarButton.getLocationOnScreen().x + toggleCalendarButton.getBounds().width - popup.getBounds().width - 2;
  int defaultY=toggleCalendarButton.getLocationOnScreen().y + toggleCalendarButton.getBounds().height + 2;
  zSetPopupLocation(popup,defaultX,defaultY,this,dateTextField,2,6);
  popup.show();
  calendarPanel.requestFocus();
}

public void openPopup ( ) { if ( settings == null ) { return ; } if ( ! isEnabled ( ) ) { return ; } if ( ! dateTextField . hasFocus ( ) ) { dateTextField . requestFocusInWindow ( ) ; } LocalDate selectedDateForCalendar = lastValidDate ; DatePicker thisDatePicker = this ; calendarPanel = new CalendarPanel ( thisDatePicker ) ; if ( selectedDateForCalendar != null ) { calendarPanel . setSelectedDate ( selectedDateForCalendar ) ; } popup = new CustomPopup ( calendarPanel , SwingUtilities . getWindowAncestor ( this ) , this , settings . getBorderCalendarPopup ( ) ) ; int defaultX = toggleCalendarButton . getLocationOnScreen ( ) . x + toggleCalendarButton . getBounds ( ) . width - popup . getBounds ( ) . width - 2 ; int defaultY = toggleCalendarButton . getLocationOnScreen ( ) . y + toggleCalendarButton . getBounds ( ) . height + 2 ; zSetPopupLocation ( popup , defaultX , defaultY , this , dateTextField , 2 , 6 ) ; popup . show ( ) ; calendarPanel . requestFocus ( ) ; }
openpopup , this opens the calendar popup . if the date picker contains a lastvaliddate , the calendar will be opened to the month and year of the lastvaliddate , with the lastvaliddate marked as selected . if the lastvaliddate is null , then the calendar will be opened with today ' s month and year displayed , and no date will be selected . this function creates a new calendar and a new custom popup instance each time that it is called . the associated object instances are automatically disposed and set to null when a popup is closed .
