Código PHP:
public class frm extends JFrame implements ActionLIstener,ItemListener{
public frm(){
JPanel panNorte = new JPanel();
JPanel panSur = new JPanel()
Object[] obj = {"op1","op2","op3","op4","op5"};
JComboBox cmb = new JComboBox(obj);
panNorte.add(cmb);
this.setLayout(new BorderLayout());
this.add(panNorte,BorderLayout.NORTH):
this.add(panSur,BorderLayout.SOUTH):
cmb.addItemListener(this);
}
public itemStateChanged(ItemEvent evt){
int cant = cmb.getSelectedIndex();
JButton[] btn = new JButton[cant];
for(int i = 0; i < cant; i++){
panSur.add(btn[i]);
btn[i].addActionListener(this);
}
}
public actionPerformed(ActionEvent evt){}
}
bueno es algo asi un empujon px = D