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

ScrollPane: tab navigation doesn't make it scroll to the focused node

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 8u20
    • 8
    • javafx
    • b114

      To reproduce:

      Scroll to the last button
      Click it
      Push tab

      Expected: scroll pane scrolled to the focused button
      Result: first button is focused but not visible

      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();
          }
      }

            msladecek Martin Sládeček
            dzinkevi Dmitry Zinkevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: