get Constraints For Cell in SpringLayout - Java Swing

Java examples for Swing:Layout Manager

Description

get Constraints For Cell in SpringLayout

Demo Code


//package com.java2s;
import javax.swing.*;
import java.awt.*;

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);
    }/*from  w w  w  . j  a v  a2 s.  c  o m*/
}

Related Tutorials