No offense, but the multitude of fundamental problems with your code most likely indicates that your understanding of the Java language is insufficient to be working with GUIs. Instead of taking the time to write out an explanation for each problem, I rewrote the code for you to study.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GUITest extends JFrame implements ActionListener {
private static JButton[] bbox;
public GUITest() {
super("GUI Test");
setLayout(new GridLayout(3,3));
bbox = new JButton[9];
for (int i = 0; i < bbox.length; i++) {
bbox[i] = new JButton(Integer.toString(i));
bbox[i].addActionListener(this);
add(bbox[i]);
}
pack();
setVisible(true);
}
public static void main(String args[]) {
new GUITest();
}
public void actionPerformed(ActionEvent evt) {
// This method is called when a button is clicked
}
}