Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4862638

SpinnerDateModel doesn't roll the year field when adding weeks in the editor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.4.1, 1.4.2
    • core-libs
    • x86
    • windows_2000



      Name: jk109818 Date: 05/12/2003


      FULL PRODUCT VERSION :
      java version "1.4.1_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
      Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)

      FULL OS VERSION :
      Microsoft Windows 2000 [Versión 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      When I add a week in the JSpinner component and the week value is the last week of month in the calendar, the year field doesn´t roll to the next year. Sorry about my english ;) I speak spanish.
      Best regards,
      Maximiliano Palacios


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.BorderLayout;
      import java.awt.Dimension;
      import java.util.Calendar;
      import java.util.Date;

      import javax.swing.JFrame;
      import javax.swing.JLabel;
      import javax.swing.JSpinner;
      import javax.swing.SpinnerDateModel;

      public class MyJSpinner {

      public static void main(String[] args) {
      JFrame.setDefaultLookAndFeelDecorated(true);
      JFrame frame = new JFrame("JSpinnerDemoBug");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      JLabel emptyLabel = new JLabel("");
      emptyLabel.setPreferredSize(new Dimension(300, 120));
      frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
      SpinnerDateModel sdm = new SpinnerDateModel(new Date(), null, null, Calendar.MONTH);
      JSpinner js = new JSpinner(sdm);
      js.setEditor(new JSpinner.DateEditor(js, "w MM/yyyy"));
      frame.getContentPane().add(js);
      frame.pack();
      frame.setVisible(true);
      }
      }
      ---------- END SOURCE ----------
      (Review ID: 185641)
      ======================================================================

            okutsu Masayoshi Okutsu
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: