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

[TextField] selection changing during minimizing window to taskbar and opening it again.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8u20
    • fx2.0.2
    • javafx
    • 2.0.2b08
      JDK6.29
      Win7

      You can see that problem in attached movie (in the bottom - output of invalidation listener about currently selected range).

      Steps to reproduce: minimize application window to taskbar and open back. Note, whether selection changing or not.

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

            jgiles Jonathan Giles
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: