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

Load & Save FileDialog opens different location for XAWT and motif

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b08
    • CPU:
      x86
    • OS:
      linux_redhat_8.0
    • Verification:
      Verified

      Description

      FileDialog in open/save mode opens the default directory location for xawt and current directory for motif. This is reproducible on Linux and solaris both.

      Since xawt is the default on Linux, the file dialog functionality differs from 1.4.2 to 1.5 (though 1.4.2 is motif based).

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

      Steps to reproduce:

      Create some temp directory and copy filedialog.java in that directory

      1. Compile filedialog.java
      2. Run with xawt mode
      3. Click on open or save button
      4. Default directory will be opened in respective mode

      5. Run with motif mode
      6. Current directory will be opened in respective mode.



      ===============================================================================
      //filedialog.java
      import java.awt.*;
      import java.awt.event.*;

      public class filedialog extends Frame {

          Button bLoad;
          Button bSave;

          filedialog fdframe = null;

          public filedialog() {
      fdframe = this;
      setLayout(new FlowLayout());
      bLoad = new Button("LOAD Dialog");
      add(bLoad);
      bLoad.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
      new FileDialog(fdframe,
      "file dialog LOAD",
      FileDialog.LOAD)
      .show();
      }
      });
      bSave = new Button("SAVE Dialog");
      add(bSave);
      bSave.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
      new FileDialog(fdframe,
      "this is a LOAD file dialog",
      FileDialog.SAVE)
      .show();
      }
      });

      pack();
      show();
          }

         public static void main(String args[]) {
      new filedialog();
      }
      }
      ================================================================================
      ###@###.### 10/11/04 09:29 GMT

        Attachments

          Activity

            People

            Assignee:
            ant Anton Tarasov
            Reporter:
            asamjisunw Aruna Samji (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: