gbc.java

来自「jdbc 学习质料」· Java 代码 · 共 51 行

JAVA
51
字号
package src.view;

import java.awt.GridBagConstraints;
import java.awt.Insets;

public class GBC extends GridBagConstraints {
  public GBC(int x, int y) {
    this.gridx = x;
    this.gridy = y;
  }

  public GBC(int gridx, int gridy, int gridwidth, int gridheight) {
    this.gridx = gridx;
    this.gridy = gridy;
    this.gridwidth = gridwidth;
    this.gridheight = gridheight;
  }

  public GBC setAnchor(int anchor) {
    this.anchor = anchor;
    return this;
  }

  public GBC setFill(int fill) {
    this.fill = fill;
    return this;
  }

  public GBC setWeight(double weightx, double weighy) {
    this.weightx = weightx;
    this.weighty = weighty;
    return this;
  }

  public GBC setInset(int distance) {
    this.insets = new Insets(distance, distance, distance, distance);
    return this;
  }

  public GBC setInset(int top, int left, int bottom, int right) {
    this.insets = new Insets(top, left, bottom, right);
    return this;
  }

  public GBC setIpad(int ipadx, int ipady) {
    this.ipadx = ipadx;
    this.ipady = ipady;
    return this;
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?