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

TCK: JSpinner's value field is not automatically adjusted when the value is incresed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 5.0
    • client-libs

      This is regarding the JSpinner value field when the JSpinner() no-arg constructor is used. According to the spec, this method will construct a spinner with an Integer SpinnerNumberModel with initial value 0 and no minimum or maximum limits.

      In the following test, when the frame is first show on the screen, the spinner is displayed with "0" as the initial value. But when increment the number to 10 or greater, or negative number, the number is not completely show.

      ------------------------------------------------------------------
      import java.awt.*;
      import javax.swing.*;

      public class ST {
          public static void main(String [] args) {
              SwingUtilities.invokeLater(new Runnable() {
                      public void run() {
                          JFrame jf = new JFrame();
                          jf.setSize(100, 100);
                                         
                          JSpinner spinner = new JSpinner();
                          JPanel panel = new JPanel();
                          panel.setLayout(new FlowLayout());
                          panel.add(spinner);
                          
                          jf.getContentPane().setLayout(new BorderLayout());
                          jf.getContentPane().add("Center", panel);
                          jf.setVisible(true);
                      }
              });
          }
      }
      ----------------------------------------------------------------------------

      Should the value field be automatically adjusted when needed ?

            svioletsunw Scott Violet (Inactive)
            hji Huafang Ji (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: