-
Bug
-
Resolution: Duplicate
-
P4
-
8u45
-
None
-
Windows 7
Iconifying and restoring a stage by clicking on the taskbar icon works fine.
However, if the stage is maximized, iconifying only works once; after restoring the stage the iconifyProperty isn't update, also it's not updated when iconifying again. Only after un-maximizing the stage, the behavior returns to normal-
{code}
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
VBox root = new VBox();
Button iconifyButton = new Button("Iconify");
iconifyButton.setOnAction(event -> primaryStage.setIconified(true));
Button maximizeButton = new Button("Maximize");
maximizeButton.setOnAction(event -> primaryStage.setMaximized(!primaryStage.isMaximized()));
root.getChildren().addAll(iconifyButton, maximizeButton);
primaryStage.iconifiedProperty().addListener((observable, oldValue, newValue) -> {
System.out.println("Iconified: " + newValue);
});
primaryStage.maximizedProperty().addListener((observable, oldValue, newValue) -> {
System.out.println("Maximized: " + newValue);
});
primaryStage.setTitle("Hello World");
primaryStage.initStyle(StageStyle.UNDECORATED);
primaryStage.setScene(new Scene(root, 100, 100));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
{code}
However, if the stage is maximized, iconifying only works once; after restoring the stage the iconifyProperty isn't update, also it's not updated when iconifying again. Only after un-maximizing the stage, the behavior returns to normal-
{code}
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
VBox root = new VBox();
Button iconifyButton = new Button("Iconify");
iconifyButton.setOnAction(event -> primaryStage.setIconified(true));
Button maximizeButton = new Button("Maximize");
maximizeButton.setOnAction(event -> primaryStage.setMaximized(!primaryStage.isMaximized()));
root.getChildren().addAll(iconifyButton, maximizeButton);
primaryStage.iconifiedProperty().addListener((observable, oldValue, newValue) -> {
System.out.println("Iconified: " + newValue);
});
primaryStage.maximizedProperty().addListener((observable, oldValue, newValue) -> {
System.out.println("Maximized: " + newValue);
});
primaryStage.setTitle("Hello World");
primaryStage.initStyle(StageStyle.UNDECORATED);
primaryStage.setScene(new Scene(root, 100, 100));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
{code}
- duplicates
-
JDK-8087997 Iconifying a maximized window does not change the iconified property, when window is un-iconified again
-
- Closed
-