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

SelectNextWord and nextWord commands work incorrectly on linux.

    Details

    • Type: Bug
    • Status: Open
    • Priority: P5
    • Resolution: Unresolved
    • Affects Version/s: 7u6
    • Fix Version/s: tbd
    • Component/s: javafx
    • Environment:

      2.2.0b21

      Description

      Run the code:


      import java.util.logging.Level;
      import java.util.logging.Logger;
      import javafx.application.Application;
      import javafx.application.Platform;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.TextField;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class JavaApplication2 extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              final TextField tf = new TextField("Text text");

              Button b = new Button("Select next word");
              b.setOnAction(new EventHandler<ActionEvent>() {

                  @Override
                  public void handle(ActionEvent t) {
                      new Thread(new Runnable() {

                          @Override
                          public void run() {
                              try {
                                  Thread.sleep(3000);
                              } catch (InterruptedException ex) {
                                  Logger.getLogger(JavaApplication2.class.getName()).log(Level.SEVERE, null, ex);
                              }
                              Platform.runLater(new Runnable() {

                                  @Override
                                  public void run() {
                                      tf.selectNextWord();// can replace with tf.nextWord();
                                  }
                              });
                          }
                      }).start();
                  }
              });

              VBox vb = new VBox();
              vb.getChildren().addAll(tf, b);
              Scene scene = new Scene(vb, 300, 300);
              stage.setScene(scene);
              stage.show();
          }
      }

      Put caret in the first word, and press ctrl+shift+right. See the selection (till the end of the word).
      Click button, and see the selection, putting caret into the first word, and waiting 3 seconds. It is till the beginning of the next word.

      That is difference.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              akirov Alexander Kirov (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported: