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

