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

JSpinner: increase/decrease buttons can have icons of different sizes

XMLWordPrintable

        Operating system: Windows XP SP2
        JDK version: I found the bug in 1.4, 1.5, 1.6, 1.7

        JSpinner increase/decrease buttons can have icons of different sizes. See the attached screen shot.

        There is a test case:
        ============ Source Begin ===============
        import javax.swing.*;
        import java.awt.*;

        public class JSpinnerArrowBug {
            private JFrame frame;

            public static void main(String[] args) throws Exception {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        (new JSpinnerArrowBug()).setupUI();
                    }
                });
            }

            private void setupUI() {
                frame = new JFrame();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                JSpinner sp = new JSpinner(new SpinnerNumberModel(10, 1, 20, 1));
                sp.setPreferredSize(new Dimension(50, 25));
                frame.getContentPane().add(sp);

                frame.getContentPane().setLayout(new FlowLayout());
                frame.setSize(new Dimension(100, 100));
                frame.setLocationRelativeTo(null);
                frame.setVisible(true);
            }
        }
        ============ Source End ================

        Testing strategy:
        1. Run the test
        2. Note that the arrow icons have different sizes

        Expected results:
        Arrow icons have the same size

        Actual results:
        Arrow icon of the upper button is larger than the icon of the lower button.

              rupashka Pavel Porvatov (Inactive)
              mlapshin Mikhail Lapshin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: