Java tutorial
//package com.java2s; import java.awt.Component; import java.awt.Container; import javax.swing.SpringLayout; public class Main { protected 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); } }