-
Bug
-
Resolution: Unresolved
-
P3
-
jfx11, 9, jfx14
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Windows 10
Java 11.0.4
A DESCRIPTION OF THE PROBLEM :
On Windows, if you have a confirmation dialog with a CheckBox as it's content:
If you click on the checkbox and then hit enter, the checkbox is checked rather than the confirmation dialog closing.
This seems to be a regression from Java 1.8 where it would close the confirmation dialog.
Note also that the Mac doesn't suffer from this same behaviour.
REGRESSION : Last worked in version 11
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached example source code
Select the checkbox
Hit Enter
Notice that the dialog doesn't close
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The dialog should close after hitting the enter key
ACTUAL -
The dialog stays open and the checkbox is ticked instead
---------- BEGIN SOURCE ----------
import java.util.Optional;
import javafx.application.Application;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ButtonType;
import javafx.scene.control.CheckBox;
import javafx.stage.Stage;
public class HelloWorld extends Application
{
public static void main(
String[] args)
{
launch(args);
}
@Override
public void start(
Stage primaryStage)
{
showDialog();
}
private void showDialog()
{
Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle("Confirmation Dialog");
alert.setHeaderText("Look, a Confirmation Dialog");
alert.setContentText("Are you ok with this?");
alert.getDialogPane().setContent(new CheckBox());
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK)
{
System.out.println("OK");
}
else
{
System.out.println("Cancel");
}
}
}
---------- END SOURCE ----------
FREQUENCY : always
Windows 10
Java 11.0.4
A DESCRIPTION OF THE PROBLEM :
On Windows, if you have a confirmation dialog with a CheckBox as it's content:
If you click on the checkbox and then hit enter, the checkbox is checked rather than the confirmation dialog closing.
This seems to be a regression from Java 1.8 where it would close the confirmation dialog.
Note also that the Mac doesn't suffer from this same behaviour.
REGRESSION : Last worked in version 11
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached example source code
Select the checkbox
Hit Enter
Notice that the dialog doesn't close
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The dialog should close after hitting the enter key
ACTUAL -
The dialog stays open and the checkbox is ticked instead
---------- BEGIN SOURCE ----------
import java.util.Optional;
import javafx.application.Application;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ButtonType;
import javafx.scene.control.CheckBox;
import javafx.stage.Stage;
public class HelloWorld extends Application
{
public static void main(
String[] args)
{
launch(args);
}
@Override
public void start(
Stage primaryStage)
{
showDialog();
}
private void showDialog()
{
Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle("Confirmation Dialog");
alert.setHeaderText("Look, a Confirmation Dialog");
alert.setContentText("Are you ok with this?");
alert.getDialogPane().setContent(new CheckBox());
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK)
{
System.out.println("OK");
}
else
{
System.out.println("Cancel");
}
}
}
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8251472 Enter, Non-Push-Button, Mac - proposing change
- Open