Open In App

Java AWT | SpringLayout Class

A SpringLayout class in AWT(Abstract Window Toolkit) laid out of the children to its associated container, according to a set of Layout constraints. Each constraint is represented by a Spring object which controls the vertical or horizontal distance between two component edges. The edges can belong to any child of the container, or to the container itself. By default, SpringLayout creates constraints that make their associated component have the minimum, preferred, and maximum and actual value.

Constructor:



Commonly Used Methods:

Below programs illustrate the SpringLayout class:



Note: The above programs might not run in an online IDE. Please use an offline compiler.

Reference: https://docs.oracle.com/javase/7/docs/api/javax/swing/SpringLayout.html


Article Tags :