Tabnine Logo
DateChooserPanel.getYears
Code IndexAdd Tabnine to your IDE (free)

How to use
getYears
method
in
org.jfree.ui.DateChooserPanel

Best Java code snippets using org.jfree.ui.DateChooserPanel.getYears (Showing top 6 results out of 315)

origin: jfree/jcommon

/**
 * Changes the contents of the year selection JComboBox to reflect the 
 * chosen date and the year range.
 */
private void refreshYearSelector() {
  if (!this.refreshing) {
    this.refreshing = true;
    this.yearSelector.removeAllItems();
    final Integer[] years = getYears(this.chosenDate.get(
        Calendar.YEAR));
    for (int i = 0; i < years.length; i++) {
      this.yearSelector.addItem(years[i]);
    }
    this.yearSelector.setSelectedItem(new Integer(this.chosenDate.get(
        Calendar.YEAR)));
    this.refreshing = false;
  }
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Changes the contents of the year selection JComboBox to reflect the 
 * chosen date and the year range.
 */
private void refreshYearSelector() {
  if (!this.refreshing) {
    this.refreshing = true;
    this.yearSelector.removeAllItems();
    final Integer[] years = getYears(this.chosenDate.get(
        Calendar.YEAR));
    for (int i = 0; i < years.length; i++) {
      this.yearSelector.addItem(years[i]);
    }
    this.yearSelector.setSelectedItem(new Integer(this.chosenDate.get(
        Calendar.YEAR)));
    this.refreshing = false;
  }
}
origin: org.jfree/jcommon

/**
 * Changes the contents of the year selection JComboBox to reflect the 
 * chosen date and the year range.
 */
private void refreshYearSelector() {
  if (!this.refreshing) {
    this.refreshing = true;
    this.yearSelector.removeAllItems();
    final Integer[] years = getYears(this.chosenDate.get(
        Calendar.YEAR));
    for (int i = 0; i < years.length; i++) {
      this.yearSelector.addItem(years[i]);
    }
    this.yearSelector.setSelectedItem(new Integer(this.chosenDate.get(
        Calendar.YEAR)));
    this.refreshing = false;
  }
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Constructs a panel containing two JComboBoxes (for the month and year) 
 * and a button (to reset the date to TODAY).
 *
 * @return the panel.
 */
private JPanel constructSelectionPanel() {
  final JPanel p = new JPanel();
  final int minMonth = this.chosenDate.getMinimum(Calendar.MONTH);
  final int maxMonth = this.chosenDate.getMaximum(Calendar.MONTH);
  final String[] months = new String[maxMonth - minMonth + 1];
  System.arraycopy(SerialDate.getMonths(), minMonth, months, 0, 
      months.length);
  this.monthSelector = new JComboBox(months);
  this.monthSelector.addActionListener(this);
  this.monthSelector.setActionCommand("monthSelectionChanged");
  p.add(this.monthSelector);
  this.yearSelector = new JComboBox(getYears(0));
  this.yearSelector.addActionListener(this);
  this.yearSelector.setActionCommand("yearSelectionChanged");
  p.add(this.yearSelector);
  return p;
}
origin: jfree/jcommon

/**
 * Constructs a panel containing two JComboBoxes (for the month and year) 
 * and a button (to reset the date to TODAY).
 *
 * @return the panel.
 */
private JPanel constructSelectionPanel() {
  final JPanel p = new JPanel();
  final int minMonth = this.chosenDate.getMinimum(Calendar.MONTH);
  final int maxMonth = this.chosenDate.getMaximum(Calendar.MONTH);
  final String[] months = new String[maxMonth - minMonth + 1];
  System.arraycopy(SerialDate.getMonths(), minMonth, months, 0, 
      months.length);
  this.monthSelector = new JComboBox(months);
  this.monthSelector.addActionListener(this);
  this.monthSelector.setActionCommand("monthSelectionChanged");
  p.add(this.monthSelector);
  this.yearSelector = new JComboBox(getYears(0));
  this.yearSelector.addActionListener(this);
  this.yearSelector.setActionCommand("yearSelectionChanged");
  p.add(this.yearSelector);
  return p;
}
origin: org.jfree/jcommon

/**
 * Constructs a panel containing two JComboBoxes (for the month and year) 
 * and a button (to reset the date to TODAY).
 *
 * @return the panel.
 */
private JPanel constructSelectionPanel() {
  final JPanel p = new JPanel();
  final int minMonth = this.chosenDate.getMinimum(Calendar.MONTH);
  final int maxMonth = this.chosenDate.getMaximum(Calendar.MONTH);
  final String[] months = new String[maxMonth - minMonth + 1];
  System.arraycopy(SerialDate.getMonths(), minMonth, months, 0, 
      months.length);
  this.monthSelector = new JComboBox(months);
  this.monthSelector.addActionListener(this);
  this.monthSelector.setActionCommand("monthSelectionChanged");
  p.add(this.monthSelector);
  this.yearSelector = new JComboBox(getYears(0));
  this.yearSelector.addActionListener(this);
  this.yearSelector.setActionCommand("yearSelectionChanged");
  p.add(this.yearSelector);
  return p;
}
org.jfree.uiDateChooserPanelgetYears

Javadoc

Returns a vector of years preceding and following the specified year. The number of years preceding and following is determined by the yearSelectionRange attribute.

Popular methods of DateChooserPanel

  • add
  • constructControlPanel
    Returns a panel that appears at the bottom of the calendar panel - contains a button for selecting t
  • constructSelectionPanel
    Constructs a panel containing two JComboBoxes (for the month and year) and a button (to reset the da
  • equalDates
    Returns true if the two dates are equal (time of day is ignored).
  • firePropertyChange
  • getButtonColor
    Returns the button color according to the specified date.
  • getCalendarPanel
    Returns a panel of buttons, each button representing a day in the month. This is a sub-component of
  • getFirstDayOfWeek
    Returns the first day of the week (controls the labels in the date panel).
  • getFirstVisibleDate
    Returns the first date that is visible in the grid. This should always be in the month preceding the
  • refreshButtons
    Update the button labels and colors to reflect date selection.
  • refreshYearSelector
    Changes the contents of the year selection JComboBox to reflect the chosen date and the year range.
  • setDate
    Sets the date chosen in the panel.
  • refreshYearSelector,
  • setDate,
  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • setScale (BigDecimal)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now