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

[TextArea] Weird scroll bar display behaviour in TextArea

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8u25
    • javafx
    • Windows 7, 64 bit

      Run the sample program:

      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.TextArea;
      import javafx.stage.Stage;

      public class SampleTextArea extends Application {

          @Override
          public void start(Stage stage) throws Exception {

              final TextArea textArea = new TextArea();
              textArea.setPrefRowCount(10);
              textArea.setPrefColumnCount(300);
              textArea.setWrapText(true);
              textArea.setPrefWidth(300);
              textArea.setPadding(new Insets(5));

              String text = "Some random text";

              textArea.setText(text);
              
              Scene scene = new Scene(textArea);
              stage.setScene(scene);
              stage.setTitle("Text Area");

              stage.show();
          }

          public static void main(String... arguments) {
              launch(arguments);
          }
      }


      1) You will notice a vertical scroll bar is displayed which shouldn't be as the scroll bar thumb fills all its available space and you cannot use it to scroll the text area.

      2) Click inside the TextArea. The scroll bar disappears. It remains invisible even if you now click outside the Stage.

      3) Now if you increase the size of the stage using mouse, the scroll bar disappears but if you decrease the size the scroll bar reappears even for the same previous size of stage. Here similarly to 1) the thumb of the scroll bar fills all its available space and you cannot use it to scroll the text area.

            leifs Leif Samuelsson (Inactive)
            asarkar Anirvan Sarkar
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: