diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
| commit | 1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch) | |
| tree | 926cef8cb76d46862ed2c4ec7028720611e47476 /src/GUIComponents/GridPanel.java | |
| download | Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2 Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip | |
added source
Diffstat (limited to 'src/GUIComponents/GridPanel.java')
| -rw-r--r-- | src/GUIComponents/GridPanel.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/GUIComponents/GridPanel.java b/src/GUIComponents/GridPanel.java new file mode 100644 index 0000000..dc8d904 --- /dev/null +++ b/src/GUIComponents/GridPanel.java @@ -0,0 +1,36 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.Component; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.GridLayout; +/* */ import javax.swing.JPanel; +/* */ +/* */ public class GridPanel extends JPanel +/* */ { +/* */ private JPanel[][] panels; +/* */ +/* */ public GridPanel(int width, int height, int spacingx, int spacingy) +/* */ { +/* 18 */ this.panels = new JPanel[width][height]; +/* 19 */ setLayout(new GridLayout(height, width)); +/* 20 */ int i = 0; for (int a = 0; i < this.panels.length; a++) { +/* 21 */ for (int j = 0; j < this.panels[0].length; a++) +/* */ { +/* 23 */ add(this.panels[i][j] = = new JPanel(new FlowLayout())); +/* */ +/* 21 */ j++; +/* */ } +/* 20 */ i++; +/* */ } +/* */ } +/* */ +/* */ public void add(Component component, int col, int row) +/* */ { +/* 30 */ this.panels[col][row].add(component); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.GridPanel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file |