Didn’t test this too well, but it should do the trick in 3.x or 4.x.
/*
Using a native JSplitPane swing component in Servoy for greater control over divider location
[*] Assumes you have a JPanel bean on your form named "bean_104"
[*] Assumes you have a Servoy tabpanel on your form named tabs_160
*/
var splitPane = new Packages.javax.swing.JSplitPane();
splitPane.topComponent = new Packages.javax.swing.JLabel("Top Component"); // Add a native swing component
splitPane.bottomComponent = forms.splitPane.elements.tabs_160; // Add a Servoy component
splitPane.setOrientation(0); // One component on top of the other
/*
Sets the location of the divider to a fixed integer value
For more on the below syntax see:
http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html#ExplicitMethod
*/
splitPane["setDividerLocation(int)"](250); // There is another constructor for setDividerLocation that allows a number type parameter also, but expects a value between 0 and 1 to represent a percent
// BorderLayout is one of a number of layout managers that could be used here
var borderLayout = new java.awt.BorderLayout(0,0);
forms.splitPane.elements.bean_104.setLayout(borderLayout);
forms.splitPane.elements.bean_104.setSize(application.getWindowHeight(), application.getWindowWidth()); // This sets the size of our JPanel, Note that the splitPane will auto-size itself to the size of the JPanel
forms.splitPane.elements.bean_104.add(splitPane,borderLayout.CENTER,0);
forms.splitPane.elements.bean_104.doLayout();
BTW…it occurred to me that you might also want to set the width of the splitPane component itself and not the divider location (at some point). If that is the case, the code above can help as well. Just set the width of the JPanel bean to whatever width you want the splitPane to be.