Class CalendarButtonBorder

  • All Implemented Interfaces:
    javax.swing.border.Border

    public class CalendarButtonBorder
    extends AbstractButtonBorder<javax.swing.JFormattedTextField,​CalendarPanel>
    The border for a DateField. This border contains a calendar "button" that allows the user to select a date in a CalendarPanel when the "button" is clicked.
    • Constructor Detail

      • CalendarButtonBorder

        public CalendarButtonBorder​(javax.swing.JFormattedTextField textField)
      • CalendarButtonBorder

        public CalendarButtonBorder​(javax.swing.JFormattedTextField textField,
                                    java.util.ResourceBundle bundle)
    • Method Detail

      • initializePopup

        protected void initializePopup​(javax.swing.JFormattedTextField borderComponent,
                                       CalendarPanel popupComponent)
        Description copied from class: AbstractButtonBorder
        Initialize the content of the popup window.
        Specified by:
        initializePopup in class AbstractButtonBorder<javax.swing.JFormattedTextField,​CalendarPanel>
        Parameters:
        borderComponent - the contained component
        popupComponent - the popup window content panel
      • paintBorder

        protected void paintBorder​(java.awt.Component c,
                                   java.awt.Graphics g,
                                   int x,
                                   int y,
                                   int width,
                                   int height,
                                   int inset)
        Description copied from class: AbstractButtonBorder
        Paint the border, including the "button".
        Specified by:
        paintBorder in class AbstractButtonBorder<javax.swing.JFormattedTextField,​CalendarPanel>
        Parameters:
        c - the component for which this border is being painted
        g - the paint graphics
        x - the x position of the painted border
        y - the y position of the painted border
        width - the width of the painted border
        height - the height of the painted border
        inset - the width of the "button"
      • getPopupLocation

        protected java.awt.Point getPopupLocation​(java.awt.Dimension screenSize,
                                                  java.awt.Dimension popupSize,
                                                  javax.swing.JFormattedTextField borderComponent)
        Description copied from class: AbstractButtonBorder
        Calculate the location to display the popup.
        Specified by:
        getPopupLocation in class AbstractButtonBorder<javax.swing.JFormattedTextField,​CalendarPanel>
        Parameters:
        screenSize - the size of the screen
        popupSize - the size of the popup window
        borderComponent - the contained component
        Returns:
        the location to use to display the popup