Prova questo:
codice:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class TestFrame extends JFrame {
private JComboBox combo1;
private JComboBox combo2;
private JPanel gridPanel;
private GridLayout gridLayout;
public TestFrame() {
super ("Test");
setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
Container contentPane = getContentPane();
Object[] items = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
combo1 = new JComboBox(items);
combo2 = new JComboBox(items);
JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
p.add(combo1);
p.add(combo2);
gridLayout = new GridLayout();
gridPanel = new JPanel(gridLayout);
contentPane.add(p, BorderLayout.NORTH);
contentPane.add(gridPanel, BorderLayout.CENTER);
ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
createGrid();
}
};
combo1.addActionListener(actionListener);
combo2.addActionListener(actionListener);
createGrid(); // iniziale 1x1
}
private void createGrid() {
Integer rows = (Integer) combo1.getSelectedItem();
Integer cols = (Integer) combo2.getSelectedItem();
gridPanel.removeAll(); // rimuove tutti i componenti
gridLayout.setRows(rows);
gridLayout.setColumns(cols);
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
gridPanel.add(new JButton((i+1) + "," + (j+1)));
}
}
pack(); // pack sul frame
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
TestFrame f = new TestFrame();
f.setVisible(true);
}
});
}
}
Seleziona qualcosa nelle combo e vedi che succede. 
NOTA: ho usato l'autoboxing/unboxing, quindi solo Java 5 o superiore.