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

JComboBox popup mispositioned if its height exceeds the screen height

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b68
    • CPU:
      x86
    • OS:
      windows_xp

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.7.0"
        Java(TM) SE Runtime Environment (build 1.7.0-b147)
        Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

        A DESCRIPTION OF THE PROBLEM :
        The popup of the JComboxBox is misplaced if the height of the popup is greater than the height of the screen.

        This happens only with the Windows L&F, the position and the size of the popup is fine with the Metal L&F.

        REGRESSION. Last worked in version 6u26

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The popup should be resized and repositioned to fit vertically on the screen.
        ACTUAL -
        The bottom of the popup is aligned on the top of the combobox. Thus only the bottom of the popup is visible. It's not possible to scroll up and select the elements at the top of the list.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

        JFrame frame = new JFrame("JComboBox Test");
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        frame.setSize(320, 200);
        frame.setLocation(0, 0);

        frame.getContentPane().setLayout(new FlowLayout());

        JComboBox combobox = new JComboBox(new DefaultComboBoxModel() {
            public Object getElementAt(int index) { return "Element " + index; }
            public int getSize() { return 100; }
        });
        combobox.setMaximumRowCount(60);
        frame.getContentPane().add(combobox);

        frame.setVisible(true);

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

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                ssadetsky Semyon Sadetsky (Inactive)
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: