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

When calls JSpinner.setEditor() the font in a JSpinner become is a bold

XMLWordPrintable

    • b120
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.5.0_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
      java version "1.6.0-beta2"
      Java(TM) SE Runtime Environment (build 1.6.0-beta2-b80)

      A DESCRIPTION OF THE PROBLEM :
      After run this code the font in a JSpinner is bold. However if don't use the methods setEditor() (see a string with a comment "!!!") the font is plain.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute the attached test case

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Font remains the same
      ACTUAL -
      Font changes.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class Debug {

         public static void main(String[] args) {
           JFrame jFrame = new JFrame();
             jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
               JSpinner editor = new JSpinner();
      editor.setEditor(new JSpinner.DefaultEditor(editor)); //!!!
         jFrame.add(editor);
           jFrame.setSize(50, 120);
             jFrame.setVisible(true);
      }
      }
      ---------- END SOURCE ----------

            pkbalakr Prem Balakrishnan (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: