Expanding a JSplitPane either to the left or right direction programmatically is actually easy if you know which component to look at. The split pane bar has a left and right arrow right? Those are actually buttons formed different within the BasicSplitPaneUI class.
Using the code below:
BasicSplitPaneUI ui = (BasicSplitPaneUI) jSplitPane1.getUI();
JButton oneClick = (JButton) ui.getDivider().getComponent(1);
will expand the JSplitPane to the right and hide the right pane while showing the left pane in full. If you want to access the button that will hide the left pane instead while making the right pane visible, use the index zero inside the getComponent() method.