congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • JFileChooser (javax.swing)
  • Join (org.hibernate.mapping)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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