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

JFileChooser works with keyboard incorrectly sometimes

XMLWordPrintable

    • b35
    • generic, x86
    • generic, windows_2000
    • Verified



      Name: iaR10016 Date: 09/15/2003


      Filed By : J2SE-SQA [###@###.###
      JDK : JDK1.5.0-b19, JDK1.4.2-b28
      Platform : all

      JFileChooser works with keyboard incorrectly sometimes.

      Please, run doit.sh script below:

      --------- test.java ---------
      import javax.swing.*;
      public class test {
        public static void main(String[] args) {
            (new JFileChooser("./dir1")).showOpenDialog(new JFrame());
            System.out.println("OK!");
         }
      }
      ---------- doit.sh ----------
      #!/bin/bash

      mkdir dir1
      mkdir dir1/dir11
      mkdir dir1/dir11/dir111
      mkdir dir1/dir11/dir112
      mkdir dir1/dir12
      mkdir dir1/dir13
      mkdir dir1/dir14
      mkdir dir1/dir15
      mkdir dir1/dir15/dir151
      mkdir dir1/dir15/dir152

      JDK="/net/linux-15/export/home/java/jdk1.5.0/linux"
      export PATH=.:$PATH
      $JDK/bin/javac test.java
      $JDK/bin/java test
      -----------------------------

      JFileChooser appears after the test class loading. Current directory is "dir1".

      Please, do the following steps to reproduce the failure:

      1. Move the focus to the file list panel (do not use mouse!) - you need to press <Tab> key
          10 times to do it. Now focus is in the file panel. There is no files selected, so the
          cursor is not highlighted.

      2. After the pressing <Down> key, "dir11" directory becomes selected. This is correct
          expected behavior.

      3. Move the cursor to "dir15" pressing <Down> key several times, then press <Enter> and
          enter "dir15" directory.

      4. Try to play with keyboard when you are inside "dir15" directory: you will see that
          it is impossible to select any files in the file list using keyboard now.

      Please, note that all is OK with "dir11" directory - if you enter it, all is OK there
      and file list can correctly get focus without mouse. It happens because "dir11" is the
      first directory in the "dir1" file list and 1 is less then the number of the files in
      "dir11" folder (2), whereas "dir15" is fifth file in "dir1" files list and the file
      number in "dir15" (2) is less then 5.

      ======================================================================

            kereminsunw Konstantin Eremin (Inactive)
            irasunw Ira Ira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: