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

FileDialog.hide() works on Solaris but not on Windows NT/95

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.1, 1.1.2
    • client-libs
    • None
    • x86, sparc
    • solaris_2.4, windows_nt

      The functionality of hiding a FileDialog does not exist on Windows, but
      does on Solaris;
      For GUI-style reasons it may be justifiable to not allow a program to hide a
      FileDialog after showing it (programmatically, without user interaction).

      However, at the very least the behavior should be documented and consistent.

      Here is a sample program to demonstrate the problem. This pops up a tiny Frame, and a FileDialog, then tries to hide the dialog; the hide() methods returns
      'immediately' on both platforms, but on Solaris has the desired side-effect
      of removing the dialog from the screen, and causing the show() method to return.
      ---------------


      import java.awt.*;

      public class F extends Thread {

        public void run(){
          System.err.println("calling show");
          FD.show();
          System.err.println("show returned");
        }

        public static void main(String[] args){
          Frame f = new Frame("F");
          f.add("Center",new Label("XXX"));
          f.pack();
          f.show();
          FileDialog d = new FileDialog(f,"Pick a file");
          F x = new F();
          x.FD = d;
          x.start();
          try{Thread.sleep(5000);}catch(Exception e){}
          System.err.println("Calling hide");
          d.hide();
          System.err.println("hide returned");
        }

        FileDialog FD;
      }

            jlockesunw Jonathan Locke (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: