6

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
java baba
  • 2,199
  • 13
  • 33
  • 45
  • Can you clarify: did you literally mean the width of the divider (i.e. the size of the piece the user can move around), or did you mean the width of the panes (i.e. the position of the divider in the `SplitPane`)? – James_D Apr 28 '14 at 16:25
  • @James_D the size of the piece the user can move around – java baba Apr 29 '14 at 05:46

2 Answers2

16

Use css to change the width of the divider:

.split-pane > .split-pane-divider {  
    -fx-padding: 0 0.75em 0 0.75em;  
} 
James_D
  • 201,275
  • 16
  • 291
  • 322
-2

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>
bvn13
  • 154
  • 11