Here you can find the source of getSplitPane(boolean vertical, JComponent left, JComponent right)
public static JSplitPane getSplitPane(boolean vertical, JComponent left, JComponent right)
//package com.java2s; /**//www .j a v a 2s . co m * This file is part of GraphJ * * Copyright (C) 2009 Nils Meier * * GraphJ is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GraphJ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GraphJ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import javax.swing.JComponent; import javax.swing.JSplitPane; public class Main { /** * Helper that creates a SplitPane */ public static JSplitPane getSplitPane(boolean vertical, JComponent left, JComponent right) { JSplitPane result = new JSplitPane(vertical ? JSplitPane.VERTICAL_SPLIT : JSplitPane.HORIZONTAL_SPLIT, left, right); result.setDividerSize(3); result.setDividerLocation(0.5D); return result; } }