net.sf.nachocalendar.components
Class MonthScroller
javax.swing.JPanel
net.sf.nachocalendar.components.MonthScroller
public class MonthScroller
extends javax.swing.JPanel
Component used to change the current month. It extends from JComboBox
and has two arrows for unitary changes. It fires a YearChangeEvent
when the month under or overflows. It also fires a ChangeEvent when
the month is changed.
MonthScroller
public MonthScroller()
Creates new form MonthScroller.
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener listener)
Registers ChangeListener to receive events.
listener
- The listener to register.
addYearChangeListener
public void addYearChangeListener(YearChangeListener listener)
Registers YearChangeListener to receive events.
listener
- The listener to register.
getMonth
public int getMonth()
Returns the current month.
isEnabled
public boolean isEnabled()
Getter for enabled property.
nextMonth
public void nextMonth()
Changes to the next month.
previousMonth
public void previousMonth()
Changes to the previous month.
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener listener)
Removes ChangeListener from the list of listeners.
listener
- The listener to remove.
removeYearChangeListener
public void removeYearChangeListener(YearChangeListener listener)
Removes YearChangeListener from the list of listeners.
listener
- The listener to remove.
setEnabled
public void setEnabled(boolean b)
Enables or disables the component.
setMonth
public void setMonth(int month)
Changes de current month.
setNextIcon
public void setNextIcon(Icon icon)
Changes the icon for the Next button.
icon
- new Icon or null to show the default arrow
setNextText
public void setNextText(String text)
Changes the text of the Next button.
text
- new text or null to show the default arrow
setPreviousIcon
public void setPreviousIcon(Icon icon)
Changes the icon for the Previous button.
icon
- new Icon or null to show the default arrow
setPreviousText
public void setPreviousText(String text)
Changes the text of the Previous button.
text
- new text or null to show the default arrow