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

[TextArea] text is improperly wrapped.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • fx2.1
    • javafx
    • 2.1b06

      Code:


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

      /**
       * @author alexandr_kirov
       */
      public class JavaFX_TextArea_ScrollTopLeft extends Application {


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

          @Override
          public void start(Stage stage) throws Exception {
              final TextArea ta = new TextArea();
              for (int i = 0; i < 1000; i++) {
                  ta.setText(ta.getText() + " some text");
                  if (i % 10 == 0)
                      ta.setText(ta.getText() + "\n");
              }

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

      It makes, so that there must be a new line after 10 strings. But I see that, what is on attached screenshot.

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

              Created:
              Updated:
              Resolved:
              Imported: