Java Swing SpringLayout getConstraintsForCell(int row, int col, Container parent, int cols)

Here you can find the source of getConstraintsForCell(int row, int col, Container parent, int cols)

Description

get Constraints For Cell

License

Open Source License

Declaration

private static SpringLayout.Constraints getConstraintsForCell(int row, int col, Container parent, int cols) 

Method Source Code


//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);
    }
}

Related

  1. fixCellWidth(Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad, int[] maxX, int[] maxY)
  2. makeGrid(final Container parent, final int rows, final int cols, final int initialX, final int initialY, final int xPad, final int yPad)
  3. makeOneLineGrid(Container parent)
  4. singleColumn(final Container container, final int initialY, final int yPad)