Details
-
Bug
-
Resolution: Fixed
-
P3
-
None
Description
Extracted from JDK-8164979.
To reproduce:
- expand any menu by mouse click;
- collapse the menu by clicking on the application's window caption;
- try to expand the same menu again
The menu will not be expanded.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class App extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
MenuBar control = new MenuBar();
for (int i = 0; i < 5; i++) {
Menu m = new Menu("Menu " + String.valueOf(i + 1));
for (int j = 0; j < 5; j++) {
m.getItems().add(new MenuItem("Item " + String.valueOf(j + 1)));
}
control.getMenus().add(m);
}
Scene scene = new Scene(new HBox(control));
stage.setScene(scene);
stage.show();
}
}
To reproduce:
- expand any menu by mouse click;
- collapse the menu by clicking on the application's window caption;
- try to expand the same menu again
The menu will not be expanded.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class App extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
MenuBar control = new MenuBar();
for (int i = 0; i < 5; i++) {
Menu m = new Menu("Menu " + String.valueOf(i + 1));
for (int j = 0; j < 5; j++) {
m.getItems().add(new MenuItem("Item " + String.valueOf(j + 1)));
}
control.getMenus().add(m);
}
Scene scene = new Scene(new HBox(control));
stage.setScene(scene);
stage.show();
}
}