java baba
java baba

Reputation: 2259

how set splitpane divider width in javafx 2

I have SplitPane in my application. This is SplitPane have divider with default width. How can i set the width of SplitPane Divider

@FXML
private SplitPane splitPane;
// splitPane here get Divider and set New Width

Upvotes: 6

Views: 11611

Answers (2)

bvn13
bvn13

Reputation: 170

For JavaFX8: If you create your view from .fxml file, you can set divider's position using the attribute dividerPosition of the node SplitPane:

<SplitPane dividerPositions="0.3">

</SplitPane>

Upvotes: -1

James_D
James_D

Reputation: 209674

Use css to change the width of the divider:

.split-pane > .split-pane-divider {  
    -fx-padding: 0 0.75em 0 0.75em;  
} 

Upvotes: 16

Related Questions