Here you can find the source of getSplitPaneComponentLength(JSplitPane splitPane, Component component)
private static double getSplitPaneComponentLength(JSplitPane splitPane, Component component)
//package com.java2s; import java.awt.*; import javax.swing.*; public class Main { private static double getSplitPaneComponentLength(JSplitPane splitPane, Component component) { // The actual size may already have been messed up, so we use the preferred size. Dimension size = component.getPreferredSize(); return (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) ? size .getWidth() : size.getHeight(); }/*from w ww . j a va 2 s .c om*/ }