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

JFileChooser.getSelectedFile() return null in JDK1.3 beta

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0
    • client-libs



      Name: skT88420 Date: 09/14/99

      =20
      1. Just using \JDK1.3demo\JFileChooserDemo\JFileChooserDemo.jar. When"open =
      Dialog" or "save Dialog" opened,I select one file named "1234" in List of D=
      ialog, then change "4321" in the Field "File name", select "metal" or "wind=
      ows" RadioButton. After click open or save button,I always get message "No =
      file was chosen"! if I use Motif UI, it's OK.

      2. The source code is:
          public void actionPerformed(ActionEvent e) {
      =09int retval =3D chooser.showDialog(frame, null);
      =09if(retval =3D=3D JFileChooser.APPROVE_OPTION) {
      =09 File theFile =3D chooser.getSelectedFile();
      =09 if(theFile !=3D null) {
      =09=09if(theFile.isDirectory()) {
      =09=09 JOptionPane.showMessageDialog(
      =09=09=09frame, "You chose this directory: " +
      =09=09=09chooser.getSelectedFile().getAbsolutePath()
      =09=09 );
      =09=09} else {
      =09=09 JOptionPane.showMessageDialog(
      =09=09=09frame, "You chose this file: " +
      =09=09=09chooser.getSelectedFile().getAbsolutePath()
      =09=09 );
      =09=09}
      =09=09return;
      =09 }
      =09}
      =09JOptionPane.showMessageDialog(frame, "No file was chosen.");
          }

      3. None.

      4.None.

      5.The output of the commands "java -version" is:
        java version "1.3beta"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
        Java*TM) HotSpot Client VM (build 1.3beta-O,mixed mode)
      The output of the commands "java -fullversion" is:
        java full version "1.3beta-O"
      (Review ID: 95141)=20
      ======================================================================

            Unassigned Unassigned
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: