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

Synth Property "ComboBox.popupInsets" is ignored

XMLWordPrintable

    • b36
    • x86
    • windows_7

        FULL PRODUCT VERSION :
        Java 7u4

        ADDITIONAL OS VERSION INFORMATION :
        Windows 7 64Bit

        A DESCRIPTION OF THE PROBLEM :
        The Synth property "ComboBox.popupInsets" is ignored in Java 7 - it works fine with Java 6.

        REGRESSION. Last worked in version 6u31

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Execute the test case and click into the comboBox. The popup appears - the popup size is 10 pixels wider than the comboBox width and the popup overlaps the comboBox by 5 pixels.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The popup size should be 10 pixels wider than the comboBox width and the popup should overlap the comboBox by 5 pixels (negative y-offset)
        ACTUAL -
        The width is equal to the comboBox width and the popup does not overlap the comboBox.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.awt.BorderLayout;
        import java.awt.Color;
        import java.awt.Dimension;
        import java.awt.EventQueue;
        import java.io.ByteArrayInputStream;
        import java.io.InputStream;

        import javax.swing.JComboBox;
        import javax.swing.JFrame;
        import javax.swing.UIManager;
        import javax.swing.border.LineBorder;
        import javax.swing.plaf.synth.SynthLookAndFeel;

        public class SynthComboBoxPopupInsetsTest extends JFrame
        {
          private static String synthXml = "<synth>" +
          " <style id=\"all\">" +
          " <font name=\"Dialog\" size=\"12\"/>" +
          " </style>" +
          " <bind style=\"all\" type=\"REGION\" key=\".*\"/>" +
          " <style id=\"arrowButton\">" +
          " <property key=\"ArrowButton.size\" type=\"integer\" value=\"18\"/>" +
          " </style>" +
          " <bind style=\"arrowButton\" type=\"region\" key=\"ArrowButton\"/>" +
          " <style id=\"comboBox\">" +
          " <property key=\"ComboBox.popupInsets\" type=\"insets\" value=\"-5 -5 5 -5\"/>" +
          " </style>" +
          " <bind style=\"comboBox\" type=\"region\" key=\"ComboBox\"/>" +
          "</synth>";
          
          public static void main(String[] args)
          {
            EventQueue.invokeLater(new Runnable(){
              public void run()
              {
                try
                {
                  new SynthComboBoxPopupInsetsTest();
                }
                catch (Exception e)
                {
                  e.printStackTrace();
                }
              }
            });
          }

          public SynthComboBoxPopupInsetsTest() throws Exception
          {
            InputStream is = new ByteArrayInputStream(synthXml.getBytes("UTF8"));
            SynthLookAndFeel laf = new SynthLookAndFeel();
            laf.load(is, SynthComboBoxPopupInsetsTest.class);
            UIManager.setLookAndFeel(laf);

            String[] data = {"Very Looooooooooooooooooooong Text Item 1", "Item 2"};
            JComboBox combo = new JComboBox(data);
            combo.setBorder(new LineBorder(Color.BLUE));
            add(combo, BorderLayout.NORTH);

            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(new Dimension(400, 300));
            setLocationRelativeTo(null);
            setVisible(true);
          }
        }

        ---------- END SOURCE ----------

              rupashka Pavel Porvatov (Inactive)
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: