Here you can find the source of getConstraintsForCell(int row, int col, Container parent, int cols)
private static SpringLayout.Constraints getConstraintsForCell(int row, int col, Container parent, int cols)
//package com.java2s; /*//from w w w . ja v a2 s . c o m * $Id$ * * Copyright (c) 2008-2009 David Muller <roxon@users.sourceforge.net>. * All rights reserved. Use of the code is allowed under the * Artistic License 2.0 terms, as specified in the LICENSE file * distributed with this code, or available from * http://www.opensource.org/licenses/artistic-license-2.0.php * * This file is adapted from a sample taken from the Java Tutorial by Sun. */ import java.awt.Component; import java.awt.Container; import javax.swing.SpringLayout; public class Main { private static SpringLayout.Constraints getConstraintsForCell(int row, int col, Container parent, int cols) { SpringLayout layout = (SpringLayout) parent.getLayout(); Component c = parent.getComponent(row * cols + col); return layout.getConstraints(c); } }