-
Bug
-
Resolution: Duplicate
-
P4
-
8
-
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();
}
}
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();
}
}
- duplicates
-
JDK-8094182 [ScrollPane] Focus traversal to the first or last item does not make the ScrollPane to scroll to that item
- Resolved