supongo que se me paso =) no tengo ahora ningun compilador no estoy en mi casa...
entonces no puedo probarlo, no se si la distribucion del layout esta bien...
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 void itemStateChanged(ItemEvent evt){
int cant = cmb.getSelectedIndex() + 1;
JButton[] btn = new JButton[cant];
for(int i = 0; i < cant; i++){
btn[i] = new JButon(""+ i);
panSur.add(btn[i]);
btn[i].addActionListener(this);
}
}
public void actionPerformed(ActionEvent evt){}
}