Here you can find the source of createSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
public static JSplitPane createSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
//package com.java2s; /*// w w w . java2 s . c o m * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved. * * This software is open source. * See the bottom of this file for the licence. * * $Id: SwingUtils.java,v 1.1.1.1 2001/05/22 08:13:01 jstrachan Exp $ */ import javax.swing.*; import java.awt.*; import javax.swing.*; public class Main { public static final Dimension ZERO_DIMENSION = new Dimension(0, 0); /** Creates a new JSplitPane, sets the name to a default value * and sets the 2 child components to a zero minimum size to allow * the split pane to resize itself. */ public static JSplitPane createSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent) { // allow the splitPane to completely resize! setZeroMinimumSize(newLeftComponent); setZeroMinimumSize(newRightComponent); JSplitPane answer = new JSplitPane(newOrientation, newLeftComponent, newRightComponent); answer.setName("SplitPane"); answer.setOneTouchExpandable(true); return answer; } /** Sets the component to a minimum size of zero to allow split panes * and layout managers from shrinking the components */ public static void setZeroMinimumSize(Component component) { if (component instanceof JComponent) { ((JComponent) component).setMinimumSize(ZERO_DIMENSION); } } }