View Javadoc

    1   package net.sourceforge.pmd.util.designer;
    2
    3   import javax.swing.*;
    4   import java.awt.Component;
    5   import java.awt.GridBagConstraints;
    6   import java.awt.GridBagLayout;
    7   import java.awt.Insets;
    8
    9   public class JSmartPanel extends JPanel {
    10
    11      private GridBagConstraints constraints = new GridBagConstraints();
    12
    13      public JSmartPanel() {
    14          super(new GridBagLayout());
    15      }
    16
    17      public void add(Component comp, int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, Insets insets) {
    18          constraints.gridx = gridx;
    19          constraints.gridy = gridy;
    20          constraints.gridwidth = gridwidth;
    21          constraints.gridheight = gridheight;
    22          constraints.weightx = weightx;
    23          constraints.weighty = weighty;
    24          constraints.anchor = anchor;
    25          constraints.fill = fill;
    26          constraints.insets = insets;
    27          add(comp, constraints);
    28      }
    29  }
    30