Java JSplitPane getSplitPane(boolean vertical, JComponent left, JComponent right)

Here you can find the source of getSplitPane(boolean vertical, JComponent left, JComponent right)

Description

Helper that creates a SplitPane

License

Open Source License

Declaration

public static JSplitPane getSplitPane(boolean vertical, JComponent left, JComponent right) 

Method Source Code

//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;
    }
}

Related

  1. createStrippedSplitPane(int orient, JComponent comp1, JComponent comp2)
  2. createUndecoratedSplitPane(int orientation)
  3. createVertSplitPane(Component left, Component right)
  4. flattenJSplitPane(JSplitPane splitPane)
  5. getPref(JSplitPane jSplitPane)
  6. getSplitPaneComponentLength(JSplitPane splitPane, Component component)
  7. getSplitPaneSize(JSplitPane splitPane)
  8. hsplit(Component left, Component right, double resizeWeight)
  9. rememberOldHeightRatio (JSplitPane splitPane)