Hi all,

Working on an exercise, but can't figure it all out. This is the code I have written at the moment:

Code:
import javax.swing.*;
import java.awt.*;

public class Sudoku extends JFrame 
{
	Sudoku()
	{
		int s[][] = 
		{ 
        		{ 0, 5, 6, 9, 1, 7, 8, 3, 2 }, 
        		{ 3, 9, 2, 6, 4, 8, 5, 1, 7 }, 
        		{ 1, 8, 7, 5, 3, 2, 9, 4, 6 },
        		{ 2, 7, 1, 4, 9, 5, 3, 6, 8 },
        		{ 8, 3, 5, 7, 6, 1, 4, 2, 9 },
       		{ 6, 4, 9, 8, 2, 3, 1, 7, 5 },
       		{ 7, 6, 4, 1, 5, 9, 2, 8, 3 },
       		{ 9, 1, 3, 2, 8, 6, 7, 5, 4 },
       		{ 5, 2, 8, 3, 7, 4, 6, 9, 1 }
       		};
		
		JButton[] b = new JButton[81];
	        for ( int row = 0; row < s.length; row++ )                   
        	{        
			for (int Kolom = 0; Kolom < int AantalKolommen = 9; Kolom++) 
			{ 
				for (int i=0; i<81; i++)
				{
					b[i] = new JButton(" ");
					if (s[i][i]!=1)
					{
						b[i].setText (""+s[i]);
					}
				add(b[i]);
				}
			}
		}
	}

	public static void main(String args[])
	{
		Sudoku s= new Sudoku();
		s.setSize(600,600);
		s.setLayout(new GridLayout(9,9));
		s.setVisible(true);
		s.setTitle("Sudoku");
	}
}
As you can see, it's using a 2-dimensional array except JButton. The problem I'm dealing with is not getting this 1-dimensional array converted to 2-dimensional. Anyone knows how to get it done?