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

JComboBox's dropdown goes upwards if dropdown's height exceeds screen's height.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • beta2
    • x86
    • generic
    • Verified

      In the JCombobox, if setMaximumRowCount() is set to a value that can make dropdown's height exceed that of the screen's, then the dropdown totally goes upwards making it difficult for the user to navigate thorugh the items.
      This happens in Windows platforms and Linux (Gnome & KDE). Solaris Sparc & X86 handle this situation nicely.

      Tested in b68.

      Code used:
      import java.awt.*;
      import java.util.*;
      import javax.swing.*;

      public class testCombo extends JPanel {
        JComboBox combo;

        public testCombo() {
          setPreferredSize(new Dimension(100, 50));
          Vector data = new Vector();
          for (int i = 0;i < 100;i++)
            data.addElement(new Integer(i));
          combo =new JComboBox(data);
          combo.setMaximumRowCount(70);
          add(combo);
        }

        public static void main(String args[]) {
          JFrame frame = new JFrame("Combo Test");

          testCombo t = new testCombo();
          frame.getContentPane().add(t);
          frame.pack();
          frame.setVisible(true);
        }
      }
      --------------------------------------------------------------------------------
      It happens in Solaris Sparc as well. Not every click brings down the combo's dropdown and the dropdown appears to flicker but actually it is going upwards.

      ###@###.### 06/18/2001
      --------------------------------------------------------------------------------

            mdavidsosunw Mark Davidson (Inactive)
            sramansunw Sridhar Raman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: