Example usage for javax.swing JSplitPane getResizeWeight

List of usage examples for javax.swing JSplitPane getResizeWeight

Introduction

In this page you can find the example usage for javax.swing JSplitPane getResizeWeight.

Prototype

public double getResizeWeight() 

Source Link

Document

Returns the number that determines how extra space is distributed.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    JButton leftComponent = new JButton("left");
    JButton rightComponent = new JButton("right");
    JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftComponent, rightComponent);
    double weight = pane.getResizeWeight(); // 0.0 by default

    weight = 1D;/*w ww.  j a  v  a2s .  c  om*/
    pane.setResizeWeight(weight);

    weight = .5D;
    pane.setResizeWeight(weight);
}