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

Property Window.locationByPlatform is not cleared by calling setVisible(false)

    XMLWordPrintable

Details

    • b112
    • generic
    • generic
    • Verified

    Description

      Platform: Windows/Solaris
      JDK: 7, 8

      The following method:
      http://download.oracle.com/javase/7/docs/api/java/awt/Window.html#setLocationByPlatform%28boolean%29

      Says:

      "Calls to setVisible, setLocation and setBounds after calling setLocationByPlatform clear this property of the Window."

      However this is not satisfied for calls setVisible(false)
      Please see the following code sample:

      -------------------------------------------------------------------------------------
      import java.awt.*;

      public class ClearPropertySetVisibleFalse {

          public static void main(String[] args) {
              final Window w = new Window((Frame)null);
              w.setLocationByPlatform(true);
              w.setVisible(false);
              System.out.println("isLocationByPlatform() = " + w.isLocationByPlatform());
          }
      }
      -------------------------------------------------------------------------------------


      The output will be

      isLocationByPlatform() = true

      Attachments

        Activity

          People

            alexsch Alexandr Scherbatiy
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: