Get a fraction of another spring using the scale() method. - Java Swing

Java examples for Swing:SpringLayout

Description

Get a fraction of another spring using the scale() method.

Demo Code

import javax.swing.JButton;
import javax.swing.Spring;

public class Main {
  public static void main(String[] args) {
    JButton c1 = new JButton();
    Spring s2 = Spring.height(c1);

    Spring fractionSpring = Spring.scale(s2, 0.40f);
  }//  ww  w. jav  a  2 s .c o  m
}

Related Tutorials