com.toedter.calendar
Class JMonthChooser
JPanel
com.toedter.calendar.JMonthChooser
- ChangeListener, ItemListener
public class JMonthChooser
extends JPanel
implements ItemListener, ChangeListener
JMonthChooser is a bean for choosing a month.
protected boolean | hasSpinner - true, if the month chooser has a spinner component
|
JMonthChooser() - Default JMonthChooser constructor.
|
JMonthChooser(boolean hasSpinner) - JMonthChooser constructor with month spinner parameter.
|
Component | getComboBox() - Returns the month chooser's comboBox text area (which allow the focus to
be set to it).
|
Locale | getLocale() - Returns the locale.
|
int | getMonth() - Returns the month.
|
String | getName() - Returns "JMonthChooser".
|
Component | getSpinner() - Returns the month chooser's comboBox bar (which allow the focus to be set
to it).
|
boolean | hasSpinner() - Returns the type of spinner the month chooser is using.
|
void | initNames() - Initializes the locale specific month names.
|
void | itemStateChanged(ItemEvent e) - The ItemListener for the months.
|
static void | main(String[] s) - Creates a JFrame with a JMonthChooser inside and can be used for testing.
|
void | setDayChooser(JDayChooser dayChooser) - Convenience method set a day chooser.
|
void | setEnabled(boolean enabled) - Enable or disable the JMonthChooser.
|
void | setLocale(Locale l) - Set the locale and initializes the new month names.
|
void | setMonth(int newMonth) - Sets the month.
|
void | setYearChooser(JYearChooser yearChooser) - Convenience method set a year chooser.
|
void | stateChanged(ChangeEvent e) - Is invoked if the state of the spnner changes.
|
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
getComboBox
public Component getComboBox()
Returns the month chooser's comboBox text area (which allow the focus to
be set to it).
getLocale
public Locale getLocale()
Returns the locale.
getMonth
public int getMonth()
Returns the month.
getName
public String getName()
Returns "JMonthChooser".
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
initNames
public void initNames()
Initializes the locale specific month names.
itemStateChanged
public void itemStateChanged(ItemEvent e)
The ItemListener for the months.
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
setDayChooser
public void setDayChooser(JDayChooser dayChooser)
Convenience method set a day chooser.
dayChooser
- the day chooser
setEnabled
public void setEnabled(boolean enabled)
Enable or disable the JMonthChooser.
enabled
- the new enabled value
setLocale
public void setLocale(Locale l)
Set the locale and initializes the new month names.
setMonth
public void setMonth(int newMonth)
Sets the month. This is a bound property.
newMonth
- the new month value
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
stateChanged
public void stateChanged(ChangeEvent e)
Is invoked if the state of the spnner changes.
Copyright B) 1999 - 2004 Kai Toedter.