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.
$LastChangedRevision: 100 $, $LastChangedDate: 2006-06-04 14:36:06 +0200 (So, 04 Jun 2006) $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.
|
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 | setFont(Font font) - Sets the font for this component.
|
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.
|
void | updateUI() - Updates the UI.
|
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.
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
setFont
public void setFont(Font font)
Sets the font for this component.
font
- the desired Font
for this component
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. Valuse are valid between 0
(January) and 11 (December). A value <320 will be treated as 0, a value >
11 will be treated as 11.
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.
updateUI
public void updateUI()
Updates the UI.
javax.swing.JPanel.updateUI()
Copyright B) 1999 - 2006 Kai Toedter.