From 0dd754d933200c2e8d1428238095e06bb2d5569c Mon Sep 17 00:00:00 2001 From: K2320390 Date: Sun, 2 Feb 2025 18:59:38 +0000 Subject: [PATCH] =?UTF-8?q?W1R3=20=E2=80=93=20Add=20Specified=20Components?= =?UTF-8?q?=20to=20the=20Edit=20Panel.=20Added=20a=20for=20loop=20to=20ini?= =?UTF-8?q?tialise=20the=20creation=20of=20the=20rows.=20In=20my=20next=20?= =?UTF-8?q?iteration=20i=20aim=20to=20create=20a=20max=20size=20for=20the?= =?UTF-8?q?=20buttons=20and=20a=20max=20spacing=20for=20the=20buttons.=20c?= =?UTF-8?q?reated=20a=20method=20specifically=20to=20create=20and=20popula?= =?UTF-8?q?te=20a=20row.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../userprofilebuilder/view/MainViewer.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/userprofilebuilder/view/MainViewer.java b/src/main/java/userprofilebuilder/view/MainViewer.java index 92f4fc5..aac4d31 100644 --- a/src/main/java/userprofilebuilder/view/MainViewer.java +++ b/src/main/java/userprofilebuilder/view/MainViewer.java @@ -18,26 +18,37 @@ public class MainViewer { public MainViewer() { + int a = 3; // this represents a value that is to declare how many rows are to be made + + viewer = new JFrame(); viewer.setTitle("User Profile Builder"); viewer.setSize(500,400); viewer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - viewer.setLayout(new FlowLayout()); + viewer.setLayout(new GridLayout(a,3)); // Because i cant remember the orientation of grid layout params it's (x,y) AKA rows , columns + + for (int i=0; i