Uses of Class
javax.swing.Spring
Package
Description
Provides a set of "lightweight" (all-Java language) components
that, to the maximum degree possible, work the same on all platforms.
-
Uses of Spring in javax.swing
Modifier and TypeMethodDescriptionstatic Spring
Spring.constant
(int pref) Returns a strut -- a spring whose minimum, preferred, and maximum values each have the valuepref
.static Spring
Spring.constant
(int min, int pref, int max) Returns a spring whose minimum, preferred, and maximum values have the values:min
,pref
, andmax
respectively.SpringLayout.Constraints.getConstraint
(String edgeName) Returns the value of the specified edge, which may be a derived value, or evennull
.SpringLayout.getConstraint
(String edgeName, Component c) Returns the spring controlling the distance between the specified edge of the component and the top or left edge of its parent.SpringLayout.Constraints.getHeight()
Returns the value of theheight
property.SpringLayout.Constraints.getWidth()
Returns the value of thewidth
property.SpringLayout.Constraints.getX()
Returns the value of thex
property.SpringLayout.Constraints.getY()
Returns the value of they
property.static Spring
Returns a spring whose minimum, preferred, maximum and value properties are defined by the heights of the minimumSize, preferredSize, maximumSize and size properties of the supplied component.static Spring
Returnsmax(s1, s2)
: a spring whose value is always greater than (or equal to) the values of boths1
ands2
.static Spring
Returns-s
: a spring running in the opposite direction tos
.static Spring
Returns a spring whose minimum, preferred, maximum and value properties are each multiples of the properties of the argument spring,s
.static Spring
Returnss1+s2
: a spring representings1
ands2
in series.static Spring
Returns a spring whose minimum, preferred, maximum and value properties are defined by the widths of the minimumSize, preferredSize, maximumSize and size properties of the supplied component.Modifier and TypeMethodDescriptionstatic Spring
Returnsmax(s1, s2)
: a spring whose value is always greater than (or equal to) the values of boths1
ands2
.static Spring
Returns-s
: a spring running in the opposite direction tos
.void
Links edgee1
of componentc1
to edgee2
of componentc2
.static Spring
Returns a spring whose minimum, preferred, maximum and value properties are each multiples of the properties of the argument spring,s
.void
SpringLayout.Constraints.setConstraint
(String edgeName, Spring s) Sets the spring controlling the specified edge.void
Sets theheight
property, which controls the height of a component.void
Sets thewidth
property, which controls the width of a component.void
Sets thex
property, which controls thex
value of a component's location.void
Sets they
property, which controls they
value of a component's location.static Spring
Returnss1+s2
: a spring representings1
ands2
in series.ModifierConstructorDescriptionConstraints
(Spring x, Spring y) Creates aConstraints
object with the specified values for itsx
andy
properties.Constraints
(Spring x, Spring y, Spring width, Spring height) Creates aConstraints
object with the specified values for itsx
,y
,width
, andheight
properties.