3
I’m having trouble creating a matrix within a JPanel
in Netbeans, I tried to customize the code by placing within the Netbeans customization code:
jPanel1.setLayout(new GridLayout(15,15)); JLabel[][] grid = new JLabel[15][15]; for(int y=0; y<15; y++){ for(int x=0; x<15; x++){ grid[x][y]=new JLabel("("+x+","+y+")"); jPanel1.add(grid[x][y]); } }
It just doesn’t show anything, I wanted to print a matrix in the interface because I need it in the development of a game.
Maybe you should put more of your code to understand why not printa nothing, apparently this their code tb was to work, I suggested the Miglayout because it had already made a similar code with him before.
– Math