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

[TextField] selection is not applied immidiately.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • fx2.1
    • fx2.0.2
    • javafx
    • 2.0.2b08

      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);
          }
      }

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

              Created:
              Updated:
              Resolved:
              Imported: