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

IconifiedProperty is not updated for maximized windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8
    • javafx
    • None
    • JavaFX 8b106, Windows7

      When a stage is maximized -> iconified -> restored, the iconifiedProperty of the stage won't get properly updated. The test below demonstrates the behavior - when the stage is iconified newValue is true, when the stage is restored the listener does not receive any event.The issue does not occur if the stage is not maximized.

      public class IconifiedPropertyTest extends Application
      {

        public static void main(String[] args)
        {
          Application.launch(IconifiedPropertyTest.class, args);
        }

        @Override
        public void start(Stage stage)
        {
          stage.iconifiedProperty().addListener(new ChangeListener<Boolean>()
          {
            @Override
            public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue)
            {
              System.err.println("isIconified: " + newValue);
            }
          });
          
          BorderPane root = new BorderPane();
          Scene scene = new Scene(root, 800, 600);
          stage.setScene(scene);
          //iconifiedProperty works fine if window is not maximized
          stage.setMaximized(true);
          stage.show();
        }
      }

            psafrata Pavel Ĺ afrata
            wzberger Wolfgang Zitzelsberger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: