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

TextArea shows unnecessary scrollbars when resizing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 8u20
    • 8u20
    • javafx
    • Java 1.8.0_20 b05 on Windows 7 and Linux

      When I resize a TextArea smaller it often displays unnecessary scrollbars that will remain when you stop resizing.

      To observe run the following test class:

      1. Drag the window border smaller in either height or width.

      2. Notice that scrollbars will show and disappear as you resize smaller,

      3. Try to stop resizing when the scrollbars are visible. Now type some text in the TextArea and watch the scrollbars properly disappear.

      ************************************ TestClass **********************************************************
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.TextArea;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;


      public class TextAreaTest extends Application {

         /** {@inheritDoc} */
         @Override public void start(Stage primaryStage) throws Exception {
            primaryStage.centerOnScreen();
            primaryStage.setHeight(350);
            primaryStage.setWidth(500);
            
            TextArea area = new TextArea();
            area.setPrefColumnCount(5);
            area.setPrefRowCount(5);
            primaryStage.setScene(new Scene( new StackPane(area) ));
            
            primaryStage.show();
         }

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

      }

            leifs Leif Samuelsson (Inactive)
            csmithjfx Charles Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: