so i'm having 3 for loops inside each other. First for loop will be for the panels creation, Second for loop is for the labels and the third for loop is for the JTextFields
I have a tabbedPane with tabs Monday - Friday. Under each tab i wish it to be set out like this:
MONDAY - TextBox
MONDAY - TextBox
MONDAY - TextBox
Tuesday will of course be TUESDAY etc.. here is the code for the for loop:
public void panelSetup(){ for(int i = 1; i <= 6; i++){ panel[i] = new Panel(); for(int f = 0; f < 5; f++){ panel[i].add(arrLabel[f][0]); for(int x = 0; x <= 8; x++){ txtBox[x] = new JTextField("", 10); panel[i].add(txtBox[x]); } } } }
The problem is that it seems to be adding up the ammount of text boxes per tab and displaying them in each tab. so instead of 9 textfields its displaying 45 per tab. and the JLabel is displaying only on the final tab which is displaying 1 of each day before that tabs 9 textboxes start. image provided below..
Attachment 622