Ejemplo n.º 1
1
  public void stateChanged(ChangeEvent e) {
    JSpinner source = (JSpinner) e.getSource();
    Calendar c = this.getDateCalendar();
    if (source.getName().equals("Hour")) {
      c.set(Calendar.HOUR_OF_DAY, getSelectedHour());
      this.date = c.getTime();
      return;
    } else if (source.getName().equals("Minute")) {
      c.set(Calendar.MINUTE, getSelectedMinute());
      this.date = c.getTime();
      return;
    } else if (source.getName().equals("Second")) {
      c.set(Calendar.SECOND, getSelectedSecond());
      this.date = c.getTime();
      return;
    }
    dayColorUpdate(true);

    if (source.getName().equals("Year")) {
      c.set(Calendar.YEAR, getSelectedYear());
    } else {
      c.set(Calendar.MONTH, getSelectedMonth() - 1);
    }
    this.date = c.getTime();
    flushWeekAndDay();
  }
Ejemplo n.º 2
0
    public void stateChanged(ChangeEvent e) {
      JSpinner source = (JSpinner) e.getSource();
      if (source.getName().equals("Hour")) {
        calendar.set(Calendar.HOUR_OF_DAY, getSelectedHour());
        return;
      }
      if (source.getName().equals("Year")) {

        calendar.set(Calendar.YEAR, getSelectedYear());
        dayPanel.removeAll();
        this.flushWeekAndDayPanal(calendar);
        dayPanel.revalidate();
        dayPanel.updateUI();
        return;
      }
      if (source.getName().equals("Month")) {
        calendar.set(Calendar.MONTH, getSelectedMonth() - 1);

        dayPanel.removeAll();
        this.flushWeekAndDayPanal(calendar);
        dayPanel.revalidate();
        dayPanel.updateUI();
        return;
      }
    }
 protected boolean isMatching(JSpinner component) {
   return component.getName().endsWith(nameEnding);
 }
Ejemplo n.º 4
0
 public String getName() {
   return spinner.getName();
 }