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

-fx-display-caret affects late

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 8
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Environment:

      8.0b69

      Description

      Run the code:

          @Override
          public void start(Stage stage) throws Exception {
              StackPane root = new StackPane();
              final TextField textField = new TextField();

              ToggleButton button = new ToggleButton("Display caret");
              button.setSelected(true);
              button.setOnAction(new EventHandler<ActionEvent>() {
                  @Override
                  public void handle(ActionEvent t) {
                      textField.setStyle("-fx-display-caret : " + ((ToggleButton) t.getSource()).isSelected() + ";");
                      System.out.println(textField.getStyle());
                      textField.requestFocus();
                  }
              });
              root.getChildren().add(VBoxBuilder.create().children(textField, button).spacing(50).alignment(Pos.CENTER).build());

              Scene scene = new Scene(root, 300, 300);
              stage.setScene(scene);
              stage.show();
          }

      When -fx-display-caret is set to false, caret is still visible. It becomes invisible, only when focus is put by mouse.
      When -fx-display-caret is set to true, caret is still invisible.

      Affected tests:
      graphics/api/control/TextBox_6aTest.java

        Attachments

          Activity

            People

            • Assignee:
              jgiles Jonathan Giles
              Reporter:
              akirov Alexander Kirov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: