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

ScrollPane: Content does not scroll using keyboard

XMLWordPrintable

      When there are no focusable controls inside the ScrollPane or when key events are not consumed by the focused control the following keys should work:

      UP Arrow - Scroll the content one row up.
      DOWN Arrow - Scroll the content one row down.
      LEFT Arrow - Scroll the content one column left.
      RIGHT Arrow - Scroll the content one column right.
      PAGE UP - Scroll the content one page up.
      PAGE DOWN - Scroll the content one page down.
      HOME - Scroll the content to the top.
      END - Scroll the content to the bottom.
      SPACEBAR - Scroll the content one row down.
      TAB - Move focus to next focusable control. If a scrolled-out control inside the scroll pane receives focus, scroll to make the newly focused control visible.
      SHIFT-TAB - Move focus to previous focusable control. If a scrolled-out control inside the scroll pane receives focus, scroll to make the newly focused control visible.

      Test 1: run HelloScrollPane (the second ScrollPane with vertical scroll bar is focused). Press DOWN Arrow to scroll the content down -> the content does not scroll.

      Test 2: run the following test. When tabbing between buttons, the content does not scroll.

      package helloworld;

      import javafx.application.Application;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.ScrollPane;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class HelloScrollPane extends Application {

          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              Application.launch(args);
          }

          @Override public void start(Stage stage) {
              
              Button b = new Button("Button");
              Button b1 = new Button("Button1");
              Button b2 = new Button("Button2");
              Button b3 = new Button("Button3");
              Button b4 = new Button("Button4");
              
              VBox vb = new VBox(30);
              vb.getChildren().addAll(b, b1, b2, b3, b4);
              
              stage.setTitle("Hello ScrollPane");
              Scene scene = new Scene(new Group(), 200, 200);

              Group root = (Group)scene.getRoot();

              ScrollPane sView = new ScrollPane();
              sView.setContent(vb);
              sView.setPrefSize(160, 160);
              sView.setLayoutX(20);
              sView.setLayoutY(20);
              sView.setPannable(true);
              sView.setVisible(true);
              root.getChildren().add(sView);

              stage.setScene(scene);
              stage.show();
          }
      }

            miflemi Mick Fleming
            jdinga Jindrich Dinga (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: