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

Double mouse clicks (to open a directory in a JFileChooser) not working

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P3
    • Resolution: Duplicate
    • 6
    • None
    • client-libs
    • x86
    • solaris_10

    Description

      FULL PRODUCT VERSION :
      java version "1.6.0-beta2"
      Java(TM) SE Runtime Environment (build 1.6.0-beta2-b78)
      Java HotSpot(TM) Client VM (build 1.6.0-beta2-b78, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      SunOS voyager 5.11 snv_33 i86pc i386 i86pc

      A DESCRIPTION OF THE PROBLEM :
      JFileChooser component does not quite work as before w.r.t. double mouse click on a directory element - i.e., the directory element does not open as expected.

      This used to work in the previous early snapshots of 1.6.0 - I think about four or five version behined the b78.

      I think this issue is related to the interactions of the newer 1.6 builds with GNOME window manager, because, I could also replicate this problem on another platform (LINUX instead of Solaris x86) under GNOME. However, when I switched the window manager to something other than GNOME, e.g., KDE then the double clicks worked without any problems.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Please see attached file called unexpected_behaviour.png.? As shown, after double clicking the projects directory, instead of the GUI showing the contents of the directory, the projects directory is selected such that you can rename the directory.? The expected_behaviour.png shows what I used to get in previous versions of 1.6.0, 1.5.x and below.

      On executing the attached source code - Single clicking on a file, e.g., /home/saeed/signature.txt , and pressing the save button produces this:
      f: /home/saeed/signature.txt
      Single clicking on a directory, changes the save button to open button.
      Double clicking on either a file or a directory causes the element to be highlighted so it can be either renamed or copied into clipboard.

      REGRESSION. Last worked in version mustang

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.io.*;
      class test {
          public static void main(String[] args) {
      JFileChooser jfc = new JFileChooser();
      jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);
      jfc.setDialogType(JFileChooser.SAVE_DIALOG);
      jfc.setMultiSelectionEnabled(false);
      int result = jfc.showSaveDialog(null);
      if (result == JFileChooser.APPROVE_OPTION)
      {
                 File f = jfc.getSelectedFile();
      System.out.println("f: " + f);
                      if (f == null) return;
      }
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      A work around is to hold the Ctrl key at the same time as the mouse double click.

      Release Regression From : mustang
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: