Please help me.....
Hey there...
I'm a beginner in learning java... that's why i need all your help here... :)
well i met some problem in these code below:
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);
}
publicvoid 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. I can't manage to pass this condition:
if (k == year)
I'm quite sure that k will be the same with the year.... but it just can't work for me.... I'm so frustated about this!!!
Can someone help me?
Thanks in advance....
Regards,
Debbie

