Skip to content

Instantly share code, notes, and snippets.

@daboross
Created March 22, 2014 15:57
Show Gist options
  • Save daboross/9709426 to your computer and use it in GitHub Desktop.
Save daboross/9709426 to your computer and use it in GitHub Desktop.
GridBagConstraints helpful class
package net.daboross.util;
import java.awt.GridBagConstraints;
import java.awt.Insets;
public class GBC extends GridBagConstraints {
public GBC anchor(int anchor) {
this.anchor = anchor;
return this;
}
public GBC fill(int fill) {
this.fill = fill;
return this;
}
public GBC gridheight(int gridheight) {
this.gridheight = gridheight;
return this;
}
public GBC gridwidth(int gridwidth) {
this.gridwidth = gridwidth;
return this;
}
public GBC gridx(int gridx) {
this.gridx = gridx;
return this;
}
public GBC gridy(int gridy) {
this.gridy = gridy;
return this;
}
public GBC insets(Insets insets) {
this.insets = insets;
return this;
}
public GBC ipadx(int ipadx) {
this.ipadx = ipadx;
return this;
}
public GBC ipady(int ipady) {
this.ipady = ipady;
return this;
}
public GBC weightx(double weightx) {
this.weightx = weightx;
return this;
}
public GBC weighty(double weighty) {
this.weighty = weighty;
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment