Here you can find the source of addGBC(JPanel panel, Component component, int gridx, int gridy, int anchor, Insets insets)
public static Component addGBC(JPanel panel, Component component, int gridx, int gridy, int anchor, Insets insets)
//package com.java2s; //License from project: Open Source License import java.awt.Component; import java.awt.GridBagConstraints; import java.awt.Insets; import javax.swing.JPanel; public class Main { public static Component addGBC(JPanel panel, Component component, int gridx, int gridy, int anchor, Insets insets) {/* www. j a va2 s. c o m*/ GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = anchor; gbc.insets = insets; gbc.gridx = gridx; gbc.gridy = gridy; panel.add(component, gbc); return component; } public static Component addGBC(JPanel panel, Component component, int gridx, int gridy, int anchor, Insets insets, float weightx) { GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = anchor; gbc.insets = insets; gbc.gridx = gridx; gbc.gridy = gridy; gbc.weightx = weightx; panel.add(component, gbc); return component; } public static Component addGBC(JPanel panel, Component component, int gridx, int gridy, int anchor, Insets insets, int gridwidth, int gridheight, int fill) { GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = gridwidth; gbc.gridheight = gridheight; gbc.anchor = anchor; gbc.fill = fill; gbc.insets = insets; gbc.gridx = gridx; gbc.gridy = gridy; panel.add(component, gbc); return component; } public static Component addGBC(JPanel panel, Component component, int gridx, int gridy, int anchor, Insets insets, int gridwidth, int gridheight, int fill, float weightx, float weighty) { GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = gridwidth; gbc.gridheight = gridheight; gbc.anchor = anchor; gbc.fill = fill; gbc.insets = insets; gbc.gridx = gridx; gbc.gridy = gridy; gbc.weightx = weightx; gbc.weighty = weighty; panel.add(component, gbc); return component; } public static Component addGBC(JPanel panel, Component component, int gridx, int gridy, int anchor, Insets insets, int gridwidth, int gridheight, int fill, float weightx) { GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = gridwidth; gbc.gridheight = gridheight; gbc.anchor = anchor; gbc.fill = fill; gbc.insets = insets; gbc.gridx = gridx; gbc.gridy = gridy; gbc.weightx = weightx; panel.add(component, gbc); return component; } }