Java JSplitPane flattenJSplitPane(JSplitPane splitPane)

Here you can find the source of flattenJSplitPane(JSplitPane splitPane)

Description

flatten J Split Pane

License

Open Source License

Declaration

public static void flattenJSplitPane(JSplitPane splitPane) 

Method Source Code

//package com.java2s;
/*/*from w ww . j  a v a  2 s .com*/
 * SK's Minecraft Launcher
 * Copyright (C) 2010-2014 Albert Pham <http://www.sk89q.com> and contributors
 * Please see LICENSE.txt for license information.
 */

import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
import javax.swing.plaf.basic.BasicSplitPaneUI;

public class Main {
    public static void flattenJSplitPane(JSplitPane splitPane) {
        splitPane.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        BasicSplitPaneUI flatDividerSplitPaneUI = new BasicSplitPaneUI() {
            @Override
            public BasicSplitPaneDivider createDefaultDivider() {
                return new BasicSplitPaneDivider(this) {
                    @Override
                    public void setBorder(Border b) {
                    }
                };
            }
        };
        splitPane.setUI(flatDividerSplitPaneUI);
        splitPane.setBorder(null);
    }
}

Related

  1. createSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
  2. createSplitPane(int orientation, Component left, Component right)
  3. createStrippedSplitPane(int orient, JComponent comp1, JComponent comp2)
  4. createUndecoratedSplitPane(int orientation)
  5. createVertSplitPane(Component left, Component right)
  6. getPref(JSplitPane jSplitPane)
  7. getSplitPane(boolean vertical, JComponent left, JComponent right)
  8. getSplitPaneComponentLength(JSplitPane splitPane, Component component)
  9. getSplitPaneSize(JSplitPane splitPane)