annotate gui/javax/swing/layout/SpringUtilities.java @ 2:e16016635b2a

Uploaded
author timpalpant
date Mon, 13 Feb 2012 22:12:06 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
1 /*
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
2 * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
3 *
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
4 * Redistribution and use in source and binary forms, with or without
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
5 * modification, are permitted provided that the following conditions
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
6 * are met:
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
7 *
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
8 * - Redistributions of source code must retain the above copyright
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
9 * notice, this list of conditions and the following disclaimer.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
10 *
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
11 * - Redistributions in binary form must reproduce the above copyright
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
12 * notice, this list of conditions and the following disclaimer in the
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
13 * documentation and/or other materials provided with the distribution.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
14 *
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
15 * - Neither the name of Oracle or the names of its
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
16 * contributors may be used to endorse or promote products derived
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
17 * from this software without specific prior written permission.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
18 *
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
20 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
26 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
27 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
30 */
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
31
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
32 package javax.swing.layout;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
33
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
34 import javax.swing.*;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
35 import javax.swing.SpringLayout;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
36 import java.awt.*;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
37
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
38 /**
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
39 * A 1.4 file that provides utility methods for
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
40 * creating form- or grid-style layouts with SpringLayout.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
41 * These utilities are used by several programs, such as
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
42 * SpringBox and SpringCompactGrid.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
43 */
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
44 public class SpringUtilities {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
45 /**
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
46 * A debugging utility that prints to stdout the component's
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
47 * minimum, preferred, and maximum sizes.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
48 */
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
49 public static void printSizes(Component c) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
50 System.out.println("minimumSize = " + c.getMinimumSize());
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
51 System.out.println("preferredSize = " + c.getPreferredSize());
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
52 System.out.println("maximumSize = " + c.getMaximumSize());
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
53 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
54
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
55 /**
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
56 * Aligns the first <code>rows</code> * <code>cols</code>
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
57 * components of <code>parent</code> in
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
58 * a grid. Each component is as big as the maximum
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
59 * preferred width and height of the components.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
60 * The parent is made just big enough to fit them all.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
61 *
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
62 * @param rows number of rows
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
63 * @param cols number of columns
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
64 * @param initialX x location to start the grid at
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
65 * @param initialY y location to start the grid at
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
66 * @param xPad x padding between cells
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
67 * @param yPad y padding between cells
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
68 */
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
69 public static void makeGrid(Container parent,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
70 int rows, int cols,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
71 int initialX, int initialY,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
72 int xPad, int yPad) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
73 SpringLayout layout;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
74 try {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
75 layout = (SpringLayout)parent.getLayout();
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
76 } catch (ClassCastException exc) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
77 System.err.println("The first argument to makeGrid must use SpringLayout.");
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
78 return;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
79 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
80
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
81 Spring xPadSpring = Spring.constant(xPad);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
82 Spring yPadSpring = Spring.constant(yPad);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
83 Spring initialXSpring = Spring.constant(initialX);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
84 Spring initialYSpring = Spring.constant(initialY);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
85 int max = rows * cols;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
86
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
87 //Calculate Springs that are the max of the width/height so that all
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
88 //cells have the same size.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
89 Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)).
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
90 getWidth();
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
91 Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)).
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
92 getHeight();
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
93 for (int i = 1; i < max; i++) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
94 SpringLayout.Constraints cons = layout.getConstraints(
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
95 parent.getComponent(i));
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
96
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
97 maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
98 maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
99 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
100
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
101 //Apply the new width/height Spring. This forces all the
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
102 //components to have the same size.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
103 for (int i = 0; i < max; i++) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
104 SpringLayout.Constraints cons = layout.getConstraints(
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
105 parent.getComponent(i));
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
106
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
107 cons.setWidth(maxWidthSpring);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
108 cons.setHeight(maxHeightSpring);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
109 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
110
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
111 //Then adjust the x/y constraints of all the cells so that they
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
112 //are aligned in a grid.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
113 SpringLayout.Constraints lastCons = null;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
114 SpringLayout.Constraints lastRowCons = null;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
115 for (int i = 0; i < max; i++) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
116 SpringLayout.Constraints cons = layout.getConstraints(
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
117 parent.getComponent(i));
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
118 if (i % cols == 0) { //start of new row
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
119 lastRowCons = lastCons;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
120 cons.setX(initialXSpring);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
121 } else { //x position depends on previous component
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
122 cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST),
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
123 xPadSpring));
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
124 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
125
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
126 if (i / cols == 0) { //first row
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
127 cons.setY(initialYSpring);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
128 } else { //y position depends on previous row
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
129 cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH),
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
130 yPadSpring));
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
131 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
132 lastCons = cons;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
133 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
134
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
135 //Set the parent's size.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
136 SpringLayout.Constraints pCons = layout.getConstraints(parent);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
137 pCons.setConstraint(SpringLayout.SOUTH,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
138 Spring.sum(
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
139 Spring.constant(yPad),
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
140 lastCons.getConstraint(SpringLayout.SOUTH)));
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
141 pCons.setConstraint(SpringLayout.EAST,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
142 Spring.sum(
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
143 Spring.constant(xPad),
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
144 lastCons.getConstraint(SpringLayout.EAST)));
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
145 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
146
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
147 /* Used by makeCompactGrid. */
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
148 private static SpringLayout.Constraints getConstraintsForCell(
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
149 int row, int col,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
150 Container parent,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
151 int cols) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
152 SpringLayout layout = (SpringLayout) parent.getLayout();
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
153 Component c = parent.getComponent(row * cols + col);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
154 return layout.getConstraints(c);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
155 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
156
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
157 /**
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
158 * Aligns the first <code>rows</code> * <code>cols</code>
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
159 * components of <code>parent</code> in
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
160 * a grid. Each component in a column is as wide as the maximum
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
161 * preferred width of the components in that column;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
162 * height is similarly determined for each row.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
163 * The parent is made just big enough to fit them all.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
164 *
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
165 * @param rows number of rows
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
166 * @param cols number of columns
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
167 * @param initialX x location to start the grid at
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
168 * @param initialY y location to start the grid at
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
169 * @param xPad x padding between cells
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
170 * @param yPad y padding between cells
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
171 */
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
172 public static void makeCompactGrid(Container parent,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
173 int rows, int cols,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
174 int initialX, int initialY,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
175 int xPad, int yPad) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
176 SpringLayout layout;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
177 try {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
178 layout = (SpringLayout)parent.getLayout();
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
179 } catch (ClassCastException exc) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
180 System.err.println("The first argument to makeCompactGrid must use SpringLayout.");
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
181 return;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
182 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
183
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
184 //Align all cells in each column and make them the same width.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
185 Spring x = Spring.constant(initialX);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
186 for (int c = 0; c < cols; c++) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
187 Spring width = Spring.constant(0);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
188 for (int r = 0; r < rows; r++) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
189 width = Spring.max(width,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
190 getConstraintsForCell(r, c, parent, cols).
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
191 getWidth());
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
192 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
193 for (int r = 0; r < rows; r++) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
194 SpringLayout.Constraints constraints =
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
195 getConstraintsForCell(r, c, parent, cols);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
196 constraints.setX(x);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
197 constraints.setWidth(width);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
198 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
199 x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad)));
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
200 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
201
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
202 //Align all cells in each row and make them the same height.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
203 Spring y = Spring.constant(initialY);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
204 for (int r = 0; r < rows; r++) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
205 Spring height = Spring.constant(0);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
206 for (int c = 0; c < cols; c++) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
207 height = Spring.max(height,
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
208 getConstraintsForCell(r, c, parent, cols).
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
209 getHeight());
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
210 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
211 for (int c = 0; c < cols; c++) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
212 SpringLayout.Constraints constraints =
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
213 getConstraintsForCell(r, c, parent, cols);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
214 constraints.setY(y);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
215 constraints.setHeight(height);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
216 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
217 y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad)));
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
218 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
219
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
220 //Set the parent's size.
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
221 SpringLayout.Constraints pCons = layout.getConstraints(parent);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
222 pCons.setConstraint(SpringLayout.SOUTH, y);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
223 pCons.setConstraint(SpringLayout.EAST, x);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
224 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
225 }