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

Motif JFileChooser ignores directory change

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
      and
      java version "1.4.2_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
      Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      SunOS zazu 5.8 Generic_108528-23 sun4u sparc SUNW,Sun-Blade-1000


      A DESCRIPTION OF THE PROBLEM :
      Using the Motif JFileChooser, if you type a directory into the path textfield, and a filename into the filename textfield, and press OK, the file returned ignores the directory name just entered, and uses the current default directory.

      This is different from standard Solaris apps, such as "Text Note"

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Run the attached program
      2. Type "/xyzzy" into the directory textfield
      3. Type "magig.cookie" into the filename textfield
      4. Press the OK Button

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect the program to print
         /xyzzy/magic.cookie
      ACTUAL -
      The program prints
         <current directory>/magic.cookie

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package bugs;

      import javax.swing.JFileChooser;
      import javax.swing.UIManager;

      public class FileChooserBug
      {
          public static void main(String[] args)
          {
              try
              {
                  UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
                  JFileChooser chooser = new JFileChooser();
                  int status = chooser.showOpenDialog(null);
                  if (status==JFileChooser.APPROVE_OPTION)
                  {
                      System.out.println(chooser.getSelectedFile().getAbsolutePath());
                  }
              }
              catch (Exception e)
              {
                  e.printStackTrace();
              }
          }
      }

      ---------- END SOURCE ----------
      ###@###.### 10/8/04 21:39 GMT

        Attachments

          Activity

            People

            • Assignee:
              shickeysunw Shannon Hickey (Inactive)
              Reporter:
              gmanwanisunw Girish Manwani (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: