Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8267648 | 8u321 | Kumar Abhishek | P3 | Resolved | Fixed | b01 |
JDK-8276739 | jfx11.0.14 | Kevin Rushforth | P3 | Resolved | Fixed |
ADDITIONAL SYSTEM INFORMATION :
Windows 10
Jdk-11.0.2 with newest JavaFX sources
Jdk1.8.0_241
A DESCRIPTION OF THE PROBLEM :
When the button types of a DialogPane are set twice, DialogPane#lookupButton does return a wrong button.
This is due DialogPane adding two list change listeners to 'buttons' (#getButtonTypes). They have the wrong order, which will result in the button bar not changing at all, but the buttonNodes list will have a new button added to it, which will not be displayed.
I will file a PR showing (via testcase) and fixing the described bug.
---------- BEGIN SOURCE ----------
public class Test extends Application {
@Override
public void start(Stage primaryStage) {
Scene scene = new Scene(new BorderPane());
primaryStage.setScene(scene);
primaryStage.show();
Dialog dialog = new Dialog();
dialog.getDialogPane().getButtonTypes().setAll(ButtonType.OK);
dialog.getDialogPane().getButtonTypes().setAll(ButtonType.OK);
Button node = (Button) dialog.getDialogPane().lookupButton(ButtonType.OK);
node.setText("TEST");
dialog.showAndWait();
// The OK button won't show 'TEST'
}
}
---------- END SOURCE ----------
FREQUENCY : always
Windows 10
Jdk-11.0.2 with newest JavaFX sources
Jdk1.8.0_241
A DESCRIPTION OF THE PROBLEM :
When the button types of a DialogPane are set twice, DialogPane#lookupButton does return a wrong button.
This is due DialogPane adding two list change listeners to 'buttons' (#getButtonTypes). They have the wrong order, which will result in the button bar not changing at all, but the buttonNodes list will have a new button added to it, which will not be displayed.
I will file a PR showing (via testcase) and fixing the described bug.
---------- BEGIN SOURCE ----------
public class Test extends Application {
@Override
public void start(Stage primaryStage) {
Scene scene = new Scene(new BorderPane());
primaryStage.setScene(scene);
primaryStage.show();
Dialog dialog = new Dialog();
dialog.getDialogPane().getButtonTypes().setAll(ButtonType.OK);
dialog.getDialogPane().getButtonTypes().setAll(ButtonType.OK);
Button node = (Button) dialog.getDialogPane().lookupButton(ButtonType.OK);
node.setText("TEST");
dialog.showAndWait();
// The OK button won't show 'TEST'
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8267648 Button types of a DialogPane are set twice, returns a wrong button
-
- Resolved
-
-
JDK-8276739 Button types of a DialogPane are set twice, returns a wrong button
-
- Resolved
-
- links to
-
Commit openjdk/jfx11u/acab9b3e
-
Commit openjdk/jfx/28475cb2
-
Review openjdk/jfx11u/58
-
Review openjdk/jfx/432
(1 links to)