Java Utililty Methods JSplitPane

List of utility methods to do JSplitPane

Description

The list of methods to do JSplitPane are organized into topic(s).

Method

voidaddTooltipsToSplitter(final JSplitPane splitpane, final String hide, final String reveal)
Add Tooltips to the Splitter arrow icons.
final int intComponentCount;
intComponentCount = splitpane.getComponentCount();
for (int i = 0; i < intComponentCount; i++) {
    final Component component;
    component = splitpane.getComponent(i);
    if (component instanceof BasicSplitPaneDivider) {
        final BasicSplitPaneDivider divider;
        final int subComponentCount;
...
voidapplyDefaultProperties(final JSplitPane comp)
Sets default background and foreground color as well as a default font for the specified component.
if (comp == null) {
    return;
applyProperties(comp, "SplitPane.background", 
        null, null);
JSplitPanecreateSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
create Split Pane
JSplitPane split = new JSplitPane(newOrientation, newLeftComponent, newRightComponent);
split.setBorder(null);
split.setDividerSize(3);
if (!(split.getUI() instanceof BasicSplitPaneUI))
    return split;
BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI()).getDivider();
if (divider != null)
    divider.setBorder(null);
...
JSplitPanecreateSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
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.
setZeroMinimumSize(newLeftComponent);
setZeroMinimumSize(newRightComponent);
JSplitPane answer = new JSplitPane(newOrientation, newLeftComponent, newRightComponent);
answer.setName("SplitPane");
answer.setOneTouchExpandable(true);
return answer;
JSplitPanecreateSplitPane(int orientation, Component left, Component right)
create Split Pane
JSplitPane pane = new JSplitPane(orientation, left, right);
return pane;
JSplitPanecreateStrippedSplitPane(int orient, JComponent comp1, JComponent comp2)
create Stripped Split Pane
JSplitPane split = new JSplitPane(orient, comp1, comp2);
split.setBorder(BorderFactory.createEmptyBorder());
SplitPaneUI splitPaneUI = split.getUI();
if (splitPaneUI instanceof BasicSplitPaneUI) {
    BasicSplitPaneUI basicUI = (BasicSplitPaneUI) splitPaneUI;
    basicUI.getDivider().setBorder(BorderFactory.createEmptyBorder());
return split;
...
JSplitPanecreateUndecoratedSplitPane(int orientation)
create an undecorated JSplitPane
JSplitPane pane = new JSplitPane(orientation);
pane.setOpaque(false);
BasicSplitPaneUI ui = new BasicSplitPaneUI();
pane.setUI(ui);
ui.getDivider().setBorder(null);
pane.setBorder(BorderFactory.createEmptyBorder());
return pane;
JSplitPanecreateVertSplitPane(Component left, Component right)
create Vert Split Pane
return createSplitPane(JSplitPane.VERTICAL_SPLIT, left, right);
voidflattenJSplitPane(JSplitPane splitPane)
flatten J Split Pane
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);
intgetPref(JSplitPane jSplitPane)
get Pref
if (jSplitPane == null) {
    return 0;
Component c = jSplitPane.getTopComponent();
if (c == null || c.getPreferredSize() == null) {
    if (jSplitPane.getSize() != null) {
        return jSplitPane.getSize().height;
    } else {
...