Create a spring by subtracting one spring from another. - Java Swing

Java examples for Swing:SpringLayout

Description

Create a spring by subtracting one spring from another.

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 s3 = Spring.sum(s2, s2);

    Spring s4 = Spring.sum(s3, Spring.minus(s2));
  }//from   w w w  . j a  v a  2  s.com
}

Related Tutorials