< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java

Print this page

        

@@ -208,10 +208,20 @@
     protected void installDefaults() {
         spinner.setLayout(createLayout());
         LookAndFeel.installBorder(spinner, "Spinner.border");
         LookAndFeel.installColorsAndFont(spinner, "Spinner.background", "Spinner.foreground", "Spinner.font");
         LookAndFeel.installProperty(spinner, "opaque", Boolean.TRUE);
+
+        JComponent editor = spinner.getEditor();
+        if (editor != null && editor instanceof JSpinner.DefaultEditor) {
+            JTextField tf = ((JSpinner.DefaultEditor) editor).getTextField();
+            if (tf != null) {
+                if (tf.getFont() instanceof UIResource) {
+                    tf.setFont(new FontUIResource(spinner.getFont()));
+                }
+            }
+        }
     }
 
 
     /**
      * Sets the <code>JSpinner's</code> layout manager to null.  This
< prev index next >