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

JComboBox: API needs to document the fact that equivalent items cause problems

XMLWordPrintable

    • kestrel
    • generic, x86
    • generic, linux, windows_nt
    • Verified


      STEPS: JDK1.2 FCS "E", Solaris/Win32
      1. Run following program,
      -----

      import com.sun.java.swing.*;
      import java.awt.*;
      import java.awt.event.*;

      public class JComboBoxTest extends JFrame {

          public JComboBoxTest () {
      super("Test");
      JComboBox cb = new JComboBox();
      cb.addItem("Item 1");
      cb.addItem("Item 1");
      cb.addItem("Item 2");
      cb.addItem("Item 3");
      cb.addItem("Item 4");
      cb.addItem("Item 1");
      getContentPane().add(cb);
      pack();
      show();
          }

          public static void main(String[] args) {
      new JComboBoxTest();
          }

      }
      -----
      2. Select "Item 2".
      -- Popup ComboBox, navigate via keyboard up/down key --
      3. Push "UP" arrow key to select "Item 1". Once selection moved upto item that has two or more same name, keyboard navigation does no longer works.
      -- Also, by mouse, cannot select second or last "Item 1".

      koushi.takahashi@japan 1998-08-11

            mdavidsosunw Mark Davidson (Inactive)
            ktakahassunw Koushi Takahashi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: