Code:
public setting(){
cboThn = new JComboBox();
for (Integer i = 1900; i <= 2007;i++){
cboThn.addItem(i);
}
cboThn.setBounds(280,40,100,20);
cboThn.setActionCommand("thn");
cboThn.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
String strCommand = e.getActionCommand();
if (strCommand.equals("thn")){
JComboBox cb = (JComboBox)e.getSource();
Integer year = (Integer)cb.getSelectedItem();
for (Integer k = 2007; k >= 1900; k = k - 12){
if (k == year){
rbo1.setSelected(true);
break;
}
}
}
}
I want to put a value inside the rbo1 (radio button). But it seems like there's a problem in the code above... i can't manage to pass this condition
can anybody here tell me where's my problem lies??
thanks in advance