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

[TextArea] text is improperly wrapped.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: fx2.1
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      2.1b06

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: