public void openPopup() {
        // If the component is disabled, do nothing.
        if (!isEnabled()) {
            return;
        }
        // If the show popup menu button is not shown, do nothing.
        if (settings.getDisplayToggleTimeMenuButton() == false) {
            return;
        }
        // If this function was called programmatically, we may need to change the focus to this
        // popup.
        if (!timeTextField.hasFocus()) {
            timeTextField.requestFocusInWindow();
        }
        // Create a new time menu.
        timeMenuPanel = new TimeMenuPanel(this, settings);

        // Create a new custom popup.
        popup = new CustomPopup(timeMenuPanel, SwingUtilities.getWindowAncestor(this),
                this, settings.borderTimePopup);
        popup.setMinimumSize(new Dimension(
                this.getSize().width + 1, timeMenuPanel.getSize().height));
        // Calculate the default origin for the popup.
        int defaultX = timeTextField.getLocationOnScreen().x;
        int defaultY = timeTextField.getLocationOnScreen().y + timeTextField.getSize().height - 1;
        // Set the popup location. (Shared function.)
        DatePicker.zSetPopupLocation(popup, defaultX, defaultY, this, timeTextField, -1, 1);
        // Show the popup and request focus.
        popup.show();
        timeMenuPanel.requestListFocus();
    }
public void openPopup ( ) { if ( ! isEnabled ( ) ) { return ; } if ( settings . getDisplayToggleTimeMenuButton ( ) == false ) { return ; } if ( ! timeTextField . hasFocus ( ) ) { timeTextField . requestFocusInWindow ( ) ; } timeMenuPanel = new TimeMenuPanel ( this , settings ) ; popup = new CustomPopup ( timeMenuPanel , SwingUtilities . getWindowAncestor ( this ) , this , settings . borderTimePopup ) ; popup . setMinimumSize ( new Dimension ( this . getSize ( ) . width + 1 , timeMenuPanel . getSize ( ) . height ) ) ; int defaultX = timeTextField . getLocationOnScreen ( ) . x ; int defaultY = timeTextField . getLocationOnScreen ( ) . y + timeTextField . getSize ( ) . height - 1 ; DatePicker . zSetPopupLocation ( popup , defaultX , defaultY , this , timeTextField , - 1 , 1 ) ; popup . show ( ) ; timeMenuPanel . requestListFocus ( ) ; }
openPopup, This creates and shows the menu popup.

This function creates a new menu panel 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.