From 0bd73df13494262f8d5d1c4d8746bcaa7704e16b Mon Sep 17 00:00:00 2001 From: k2320390 Date: Mon, 3 Feb 2025 12:06:57 +0000 Subject: [PATCH] =?UTF-8?q?W1R5=20=E2=80=93=20'User=20Name'=20Tabbed=20Pan?= =?UTF-8?q?e=20for=20your=20'Name'=20Edit=20Panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- added a function to create tabs. making it easier to make them modular. --- .../userprofilebuilder/view/MainViewer.java | 50 ++++++++++++------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/src/main/java/userprofilebuilder/view/MainViewer.java b/src/main/java/userprofilebuilder/view/MainViewer.java index 277882d..bdd2064 100644 --- a/src/main/java/userprofilebuilder/view/MainViewer.java +++ b/src/main/java/userprofilebuilder/view/MainViewer.java @@ -15,7 +15,10 @@ import javax.swing.JFrame; */ public class MainViewer { private JFrame viewer; - + + + public int a = 3; // this represents a value that is to declare how many rows are to be made + private void CreateRow(int count, JPanel jp) // Function to create a row // holds all the data of a row in the grid layout below. { @@ -34,30 +37,43 @@ public class MainViewer { System.out.println("Row number: "+ count + " Has been created!"); } - + + + public void TabMaker(String Pname, JTabbedPane JT) + { + + JPanel page = new JPanel(); + + page.setLayout(new GridLayout(a,3)); // Because i cant remember the orientation of grid layout params it's (x,y) AKA rows , columns + + JT.addTab(Pname, page); + + for (int i=0; i