I am making a Sudoku board GUI which should look like this one http://www.sudoku.4thewww.com/Grids/grid.jpg
For some reason it is only showing the last 3*3 board. If someone could tell me what I am doing wrong I would greatly appreciate it thanks.
import java.awt.*;
import java.util.Random;
import java.awt.*; 
import java.awt.event.*;
import javax.swing.*;
public class gui2 extends JFrame{
private JTextField f[][]= new JTextField[9][9] ;
private JPanel p[][]= new JPanel [3][3];
public gui2(){
    super("Sudoku");
    setLayout(new GridLayout());
    for(int x=0; x<=8; x++){
        for(int y=0; y<=8; y++){
            f[x][y]=new JTextField(1);
        }
    }
    for(int x=0; x<=2; x++){
        for(int y=0; y<=2; y++){
            p[x][y]=new JPanel(new GridLayout(3,3));
        }
    }
    setLayout(new GridLayout(3,3,5,5));
for(int u=0; u<=2; u++){
    for(int i=0; i<=2; i++){    
        for(int x=0; x<=2; x++ ){
            for(int y=0; y<=2; y++){
            p[u][i].add(f[y][x]);
            }
        }
        add(p[u][i]);
    }
}
}
}
 
    