KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > util > designer > JSmartPanel


1 package net.sourceforge.pmd.util.designer;
2
3 import javax.swing.*;
4 import java.awt.Component JavaDoc;
5 import java.awt.GridBagConstraints JavaDoc;
6 import java.awt.GridBagLayout JavaDoc;
7 import java.awt.Insets JavaDoc;
8
9 public class JSmartPanel extends JPanel {
10
11     private GridBagConstraints JavaDoc constraints = new GridBagConstraints JavaDoc();
12
13     public JSmartPanel() {
14         super(new GridBagLayout JavaDoc());
15     }
16
17     public void add(Component JavaDoc comp, int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, Insets JavaDoc 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
31
Popular Tags