Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8304022 | jfx17.0.7 | Johan Vos | P4 | Resolved | Fixed |
A DESCRIPTION OF THE PROBLEM :
If we set TabDragPolicy to REORDER, when attempting to display an alert message when a tab is selected, the tabs freeze. We are no longer able to select the tabs. The rest of the UI is responsive however.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set TabPane TabDragPolicy to REORDER.
Add two tabs inside a TabPane.
Add a ChangeListener to selectionProperty of each tab.
Inside the change listener, display a simple alert message.
Initially first tab is selected (by default) and alert message is displayed.
Select second tab. Alert message is displayed.
Select first tab again. Alert message is displayed.
Try to select second tab again.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Second tab gets selected and alert message is displayed.
ACTUAL -
Second tab does not select.
---------- BEGIN SOURCE ----------
public class Controller {
@FXML private TabPane tabPane;
@FXML
public void initialize() {
tabPane.setTabDragPolicy(TabPane.TabDragPolicy.REORDER);
for (int i = 0; i < 2; i++) {
Tab tab = new Tab("Untitled Tab " + (i + 1));
tab.setClosable(true);
tab.selectedProperty().addListener((obs, oldVal, newVal) -> {
if (newVal) {
Platform.runLater(() -> {
Alert alert = new Alert(Alert.AlertType.INFORMATION, "Hello World!");
alert.showAndWait();
});
}
});
tabPane.getTabs().add(tab);
}
}
}
---------- END SOURCE ----------
FREQUENCY : always
If we set TabDragPolicy to REORDER, when attempting to display an alert message when a tab is selected, the tabs freeze. We are no longer able to select the tabs. The rest of the UI is responsive however.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set TabPane TabDragPolicy to REORDER.
Add two tabs inside a TabPane.
Add a ChangeListener to selectionProperty of each tab.
Inside the change listener, display a simple alert message.
Initially first tab is selected (by default) and alert message is displayed.
Select second tab. Alert message is displayed.
Select first tab again. Alert message is displayed.
Try to select second tab again.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Second tab gets selected and alert message is displayed.
ACTUAL -
Second tab does not select.
---------- BEGIN SOURCE ----------
public class Controller {
@FXML private TabPane tabPane;
@FXML
public void initialize() {
tabPane.setTabDragPolicy(TabPane.TabDragPolicy.REORDER);
for (int i = 0; i < 2; i++) {
Tab tab = new Tab("Untitled Tab " + (i + 1));
tab.setClosable(true);
tab.selectedProperty().addListener((obs, oldVal, newVal) -> {
if (newVal) {
Platform.runLater(() -> {
Alert alert = new Alert(Alert.AlertType.INFORMATION, "Hello World!");
alert.showAndWait();
});
}
});
tabPane.getTabs().add(tab);
}
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8304022 Alert disables Tab selection when TabDragPolicy REORDER is used
- Resolved