Yes you create the Button array, but you never initialize the elements of the array before using. This means that you're adding null Buttons to your GUI. Create your Buttons first before using.
for(int i=0;i<10;i++)
b[i] = new Button();
add(b[i]);
}