类 JMonthChooser

    • 字段详细资料

      • hasSpinner

        protected boolean hasSpinner
        true, if the month chooser has a spinner component
    • 构造器详细资料

      • JMonthChooser

        public JMonthChooser()
        Default JMonthChooser constructor.
      • JMonthChooser

        public JMonthChooser​(boolean hasSpinner)
        JMonthChooser constructor with month spinner parameter.
        参数:
        hasSpinner - true, if the month chooser should have a spinner component
    • 方法详细资料

      • initNames

        public void initNames()
        Initializes the locale specific month names.
      • stateChanged

        public void stateChanged​(ChangeEvent e)
        Is invoked if the state of the spinner changes.
        指定者:
        stateChanged 在接口中 ChangeListener
        参数:
        e - the change event.
      • setMonth

        public void setMonth​(int newMonth)
        Sets the month. This is a bound property. Valuse are valid between 0 (January) and 11 (December). A value < 0 will be treated as 0, a value > 11 will be treated as 11.
        参数:
        newMonth - the new month value
        另请参阅:
        getMonth()
      • getMonth

        public int getMonth()
        Returns the month.
        返回:
        the month value
      • setDayChooser

        public void setDayChooser​(JDayChooser dayChooser)
        Convenience method set a day chooser.
        参数:
        dayChooser - the day chooser
      • setYearChooser

        public void setYearChooser​(JYearChooser yearChooser)
        Convenience method set a year chooser. If set, the spin for the month buttons will spin the year as well
        参数:
        yearChooser - the new yearChooser value
      • setLocale

        public void setLocale​(Locale l)
        Set the locale and initializes the new month names.
        覆盖:
        setLocale 在类中 Component
        参数:
        l - the new locale value
        另请参阅:
        getLocale()
      • setEnabled

        public void setEnabled​(boolean enabled)
        Enable or disable the JMonthChooser.
        覆盖:
        setEnabled 在类中 JComponent
        参数:
        enabled - the new enabled value
      • getComboBox

        public Component getComboBox()
        Returns the month chooser's comboBox text area (which allow the focus to be set to it).
        返回:
        the combo box
      • getSpinner

        public Component getSpinner()
        Returns the month chooser's comboBox bar (which allow the focus to be set to it).
        返回:
        Component the spinner or null, if the month chooser has no spinner
      • hasSpinner

        public boolean hasSpinner()
        Returns the type of spinner the month chooser is using.
        返回:
        true, if the month chooser has a spinner
      • setFont

        public void setFont​(Font font)
        Sets the font for this component.
        覆盖:
        setFont 在类中 JComponent
        参数:
        font - the desired Font for this component
      • main

        public static void main​(String[] s)
        Creates a JFrame with a JMonthChooser inside and can be used for testing.
        参数:
        s - The command line arguments