diff options
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 |