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

JList doesn't handle search function appropriately

XMLWordPrintable

    • tiger
    • x86
    • linux, windows_2000



      Name: dk106046 Date: 08/18/2003

      OPERATING SYSTEM(S):
      --------------------
      RedHat 7.3

      FULL JDK VERSION(S):
      -------------------
      java version "1.4.1_03"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
      Java HotSpot(TM) Client VM (build 1.4.1_03-b02, mixed mode)

      java version "1.4.2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
      Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)


      ------------
      JList has a search function to jump the item which starting input character.
      However, when the item starts more than two same character, the search
      function doesn't work correctly.
      MS-Windows' Explorer has same function, but it works fine.

      Recreate Steps:

      1. Compile the test code and run it.
      ---JListTest.java----------------------
      import javax.swing.*;

      public class JListTest extends JFrame {
          public JListTest(String title) {
              setTitle(title);
              String[] data = {"aaa","aab","aac","aad","ade","bba"};
              getContentPane().add(new JList(data));
              setSize(500, 300);
              show();
          }
          public static void main(String[] args) {
              JListTest frame = new JListTest("Swing JList Component");
              frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
          }
      }
      ---------------------------------------

      Then, JList with the following items appears.
      ---------------------
      aaa
      aab
      aac
      aad
      ade
      bba
      ---------------------
      2. Click "aaa" to get focus.

      3. Type "aad" quickly, then the cursor should be at "aad".
         But, the cursor was at "ade". <= Problem.

      [This bug is being submitted as a courtesy, in order to maintain uniformity between Sun & IBM JDKs. It has been fixed in IBM JDKs.
      Please contact ###@###.### if you have questions.]
      ======================================================================

            apikalev Andrey Pikalev
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: