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

[TextField] selection is not applied immidiately.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.0.2
    • Fix Version/s: fx2.1
    • Component/s: javafx
    • Labels:
    • Environment:

      2.0.2b08

      Description

      Testcase:
      Run it and you can see in output, that selection is 0,24, but it become blue after minimazing/opening window (I mean, taskbar). You can see on attached movie.

      import javafx.application.Application;
      import javafx.beans.InvalidationListener;
      import javafx.beans.Observable;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.control.TextField;
      import javafx.stage.Stage;

      public class HelloTextField extends Application {
          private Group content;

          @Override
          public void start(Stage stage) throws Exception {
              stage.setScene(new Scene(content = new Group(), 500, 500));
              stage.centerOnScreen();
              stage.show();

              final TextField label = new TextField();
              label.setPromptText("Enter Pithy Pun");
              label.setText("bbbbbbbbbbbbbbbbbbbbb");
              label.selectionProperty().addListener(new InvalidationListener() {
                  public void invalidated(Observable o) {
                      System.out.println(label.getSelection());
                  }
              });
              label.selectAll();
              content.getChildren().add(label);
              //label.setText("aaa");
          }

          public static void main(String[] args) {
              Application.launch(HelloTextField.class, args);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                leifs Leif Samuelsson (Inactive)
                Reporter:
                akirov Alexander Kirov (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: