See attached movie and attached code:
Problem: if orientation has changed from horizontal to vertical, arrows' orientation was not changed.
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ScrollBar;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class ScrollBarProblem extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Button someButton = new Button("SomeButton");
final ScrollBar slider = new ScrollBar();
someButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
slider.setOrientation(Orientation.VERTICAL);
}
});
VBox pane = new VBox();
pane.getChildren().addAll(slider, someButton);
Scene scene = new Scene(pane, 200, 200);
stage.setScene(scene);
stage.show();
}
}
Problem: if orientation has changed from horizontal to vertical, arrows' orientation was not changed.
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ScrollBar;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class ScrollBarProblem extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Button someButton = new Button("SomeButton");
final ScrollBar slider = new ScrollBar();
someButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
slider.setOrientation(Orientation.VERTICAL);
}
});
VBox pane = new VBox();
pane.getChildren().addAll(slider, someButton);
Scene scene = new Scene(pane, 200, 200);
stage.setScene(scene);
stage.show();
}
}