com.toedter.calendar

Class JYearChooser

Implemented Interfaces:
ActionListener, CaretListener, ChangeListener, FocusListener

public class JYearChooser
extends JSpinField

JYearChooser is a bean for choosing a year.
Version:
$LastChangedRevision: 85 $, $LastChangedDate: 2006-04-28 13:50:52 +0200 (Fr, 28 Apr 2006) $

Field Summary

protected JDayChooser
dayChooser
protected int
endYear
protected int
oldYear
protected int
startYear

Fields inherited from class com.toedter.components.JSpinField

darkGreen, max, min, spinner, textField, value

Constructor Summary

JYearChooser()
Default JCalendar constructor.

Method Summary

int
getEndYear()
Returns the endy ear.
int
getStartYear()
Returns the start year.
int
getYear()
Returns the year.
static void
main(String[] s)
Creates a JFrame with a JYearChooser inside and can be used for testing.
void
setDayChooser(JDayChooser dayChooser)
Convenience method set a day chooser that might be updated directly.
void
setEndYear(int endYear)
Sets the end ear.
void
setStartYear(int startYear)
Sets the start year.
void
setValue(int value)
Sets the year value.
void
setYear(int y)
Sets the year.

Methods inherited from class com.toedter.components.JSpinField

actionPerformed, adjustWidthToMaximumValue, caretUpdate, focusGained, focusLost, getMaximum, getMinimum, getSpinner, getValue, main, setEnabled, setFont, setForeground, setHorizontalAlignment, setMaximum, setMinimum, setValue, setValue, stateChanged

Field Details

dayChooser

protected JDayChooser dayChooser

endYear

protected int endYear

oldYear

protected int oldYear

startYear

protected int startYear

Constructor Details

JYearChooser

public JYearChooser()
Default JCalendar constructor.

Method Details

getEndYear

public int getEndYear()
Returns the endy ear.
Returns:
the end year

getStartYear

public int getStartYear()
Returns the start year.
Returns:
the start year.

getYear

public int getYear()
Returns the year.
Returns:
the year

main

public static void main(String[] s)
Creates a JFrame with a JYearChooser inside and can be used for testing.
Overrides:
main in interface JSpinField
Parameters:
s - command line arguments

setDayChooser

public void setDayChooser(JDayChooser dayChooser)
Convenience method set a day chooser that might be updated directly.
Parameters:
dayChooser - the day chooser

setEndYear

public void setEndYear(int endYear)
Sets the end ear.
Parameters:
endYear - the end year

setStartYear

public void setStartYear(int startYear)
Sets the start year.
Parameters:
startYear - the start year

setValue

public void setValue(int value)
Sets the year value.
Overrides:
setValue in interface JSpinField
Parameters:
value - the year value

setYear

public void setYear(int y)
Sets the year. This is a bound property.
Parameters:
y - the new year

Copyright B) 1999 - 2009 Kai Toedter.