0
votes

I am using JavaFX and I am having a problem with using multiple TextArea's. I set all 3 of them as editable however I can only click in and edit the first one. I can hit SHIFT-TAB to go backwards to the 3rd one then the 2nd one. After that I can click on them all. I'm not too sure what is going on and any help will be appreciated. Thanks.

1

1 Answers

0
votes

I can't reproduce the behaviour you describe. For the sample program below I can click and edit any of the 3 displayed TextAreas without having to first SHIFT-TAB. I am using JavaFX Version: 2.1.0-beta-b10 on Windows7.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class MultiTextAreas extends Application {
  public static void main(String[] args) { launch(args); }
  @Override public void start(Stage stage) throws Exception {
    System.out.println("JavaFX Version: " + System.getProperties().get("javafx.runtime.version"));
    VBox layout = new VBox(10);
    for (int i = 0; i < 3; i++) layout.getChildren().add(new TextArea("Area " + i));
    layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10;");
    stage.setScene(new Scene(layout));
    stage.show();
  }
}