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

getLocation on minimized window returns (3000,3000) or (-32000, -32000)

XMLWordPrintable

    • x86
    • windows_95, windows_nt



      Name: rm29839 Date: 02/23/98


      import java.awt.*;
      import java.awt.event.*;

      // See what mouse clicks and key clicks are really doing.

      class Test21 extends Frame
      {
        Test21(String name)
        {
          super(name);

          final String myName = name;

          addComponentListener
            (new ComponentAdapter()
             {
      public void componentResized(ComponentEvent e)
      {
      System.out.println(myName+" resized "+e);
      }
      public void componentMoved(ComponentEvent e)
      {
      System.out.println(myName+" moved "+e);
      }
             }
      );

          addWindowListener
            (new WindowAdapter()
             {
      public void windowClosing(WindowEvent e)
      {
      System.out.println("firing down!");
      System.exit(0);
      }
      public void windowIconified(WindowEvent e)
      {
      System.out.println(myName+" iconified "+e);
      report();
      }
      public void windowDeiconified(WindowEvent e)
      {
      System.out.println(myName+" deiconified "+e);
      report();
      }

             }
      );
          
          setLayout(null);
        }

        void report()
        {
          System.out.print("...Showing = " + isShowing());
          System.out.print(", Enabled = " + isEnabled());
          System.out.print(", Visible = " + isVisible());
          System.out.println();
          System.out.println("...bounds = " + getBounds());
          System.out.println("...locationOnScreen = " + getLocationOnScreen());
        }

        public static void main(String args[])
        {
          int max = 10;
          System.out.println("Firing up");
          Frame first = new Test21("First");
          first.setSize(500, 500);
          first.show();
        }
          
      }

      Just iconify and deiconify the window.
      (Review ID: 25308)
      ======================================================================

            rraysunw Richard Ray (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: