Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8096592

ChoiceDialog focus traversal does not include Cancel button

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8u40
    • javafx
    • None
    • U:\>java -version
      java version "1.8.0_40-ea"
      Java(TM) SE Runtime Environment (build 1.8.0_40-ea-b06)
      Java HotSpot(TM) 64-Bit Server VM (build 25.40-b10, mixed mode)

      In a simple ChoiceDialog (for example, see the minimal test program below), pressing the TAB key to move the focus to the next component does not include the 'Cancel' button in the traversal.

      import java.util.Optional;

      import javafx.application.Application;
      import javafx.scene.control.ChoiceDialog;
      import javafx.stage.Stage;

      public class DialogTest extends Application {

          public static void main(String[] args) {
              launch(args);
          }
       
          @Override
          public void start(Stage stage) {
      ChoiceDialog<String> choiceDialog = new ChoiceDialog<>("A", "A", "B", "C");
      choiceDialog.setTitle("this is the title");
      choiceDialog.setContentText("This is the content text.");
      choiceDialog.setHeaderText(null);
      Optional<String> result = choiceDialog.showAndWait();
      if (result.isPresent()) {
         System.out.println(result.get());
      } else {
      System.out.println("No selection");
      }
          }
      }

            jgiles Jonathan Giles
            dgilbertjfx David Gilbert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: