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

[1939 byte] By [decloveya] at [2007-11-26 17:35:53]
# 1
Integer is the object.When you compare object dont use == instead use equals method.objectA.equals(objectB)
lupansanseia at 2007-7-9 0:03:58 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks thanks thanks....Thanks a lots lupansansei!!!!I'm so stupid..... lol.....Best Regards,Debbie
decloveya at 2007-7-9 0:03:58 > top of Java-index,Java Essentials,Java Programming...
# 3
>Integer k = 2007; k >= 1900; k = k - 12I'm not sure what you want to do, but isnt that loop suppose to look like Integer k = 2007; k >= 1900; k = k-1as it seems that you are checking for year.Message was edited by: lupansansei
lupansanseia at 2007-7-9 0:03:58 > top of Java-index,Java Essentials,Java Programming...