Component attributes changed programmatically but aren't taken into account

Hello everyone,

I tried to change a JLabel's and JTextField's attributes, all this inside a JButton's ActionListener, but the changes don't seem to be takin into account. I did a debug and they are correctly set, but the changes don't show up on the GUI. Here's what I did :

editButton =new JButton(EDIT_BUTTON_TEXT);

editButton.addActionListener(new ActionListener(){

publicvoid actionPerformed(ActionEvent event){

finalint profilenameIndex = ProfileFields.PROFILE_NAME.ordinal();

labelArray[profilenameIndex].setForeground(Color.LIGHT_GRAY);

textFieldArray[profilenameIndex].setEnabled(false);

textFieldArray[profilenameIndex].setBackground(Color.LIGHT_GRAY);

}

});

labelArray[profilenameIndex]

and textFieldArray[profilenameIndex]

do reference the correct objects, I checked that.

Any ideas anyone?

Thank you,

Gabriel

[1276 byte] By [rossettigaba] at [2007-10-3 3:30:37]
# 1
works OK for me.check you do not have duplicate declarations i.e. the components showing on the screen possibly are not the ones being referenced by the actionListener
Michael_Dunna at 2007-7-14 21:24:32 > top of Java-index,Desktop,Core GUI APIs...
# 2
Ok, thanks, I need a teddy bear..... I found my error, I was restoring the original values at the wrong moment, so that's why it didn't work, thanks :-)
rossettigaba at 2007-7-14 21:24:32 > top of Java-index,Desktop,Core GUI APIs...