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

FileDialog.show does not return until event generated

XMLWordPrintable

    • 1.1.6
    • x86
    • windows_nt
    • Not verified

        JDK1.1.6L, AWT Core, Regression

        Short description:
        ---------------------
        When invoked from a Dialog, FileDialog does not return from show() until
        focus changes, a key is pressed, or the mouse re-enters the calling
        dialog.

        This is a bad regression for JBuilder, as many of our PropertyEditors call
        out to a FileDialog, and JBuilder appears as if it is locked-up until the user
        clicks on a different application window.

        Steps/Code:
        ---------------
        Use the following code to show the bug (instructions embedded in the
        code).

        import java.awt.*;
        import java.awt.event.*;
        public class HangingFiler extends Dialog {
          public HangingFiler(Frame frame) {
            super(frame, "HangingFiler Dialog");
            setLayout(new BorderLayout());
            Button b = new Button();
            b.setLabel("click to invoke FileDialog");
            b.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                FileDialog fd = new FileDialog((Frame)getParent());
                System.out.println("- Showing FileDialog. Select any file and click
        OK.");
                System.out.println(" - Show will not return until focus changes, a
        key is typed,");
                System.out.println(" or the mouse enters the HangingFiler
        dialog...");
                fd.show();
                System.out.println(" - Show returned. File=" + fd.getDirectory() +
        fd.getFile());
              }
            });
            add(b, BorderLayout.CENTER);
          }
          public final static void main(String[] args) {
            HangingFiler hf = new HangingFiler(new Frame());
            hf.setBounds(400, 400, 300, 100);
            hf.show();
          }
        }


              rkhansunw Robi Khan (Inactive)
              rkhansunw Robi Khan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: