Reputation: 1670
I want to add visual separator which can be dragged and resized by the used. I tested this code:
public class VerticalSeparator {
public void initVSeparator(Stage primaryStage, Group root, Scene scene) {
//Vertical separator
Separator separator2 = new Separator();
separator2.setLayoutX(300);
separator2.setLayoutY(300);
separator2.setOrientation(Orientation.VERTICAL);
root.getChildren().add(separator2);
}
}
But for some reason I don't get anything into the primary stage. Can you tell me what I'm missing?
Upvotes: 0
Views: 285
Reputation: 34518
There is SplitPane control which provides a draggable separator.
SplitPane pane = new SplitPane();
pane.getItems().addAll(myTable, myAccordion);
P.S.: It's hard to tell what's wrong with your code without seeing usage of VerticalSeparator
class.
Upvotes: 3