get Grid Bag Constraints - Java Swing

Java examples for Swing:GridBagLayout

Description

get Grid Bag Constraints

Demo Code


//package com.java2s;

import java.awt.GridBagConstraints;

public class Main {
    public static GridBagConstraints getGridBagConstraints(int gridX,
            int gridY, int gridWidth, int gridHeight, int fill, int anchor) {
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = gridX;//w w w  . j av  a2s .c  o m
        gbc.gridy = gridY;
        gbc.gridwidth = gridWidth;
        gbc.gridheight = gridHeight;
        gbc.fill = fill;
        gbc.anchor = anchor;

        return gbc;
    }
}

Related Tutorials