JTextField.setText(String s) not working?
I have some code in a for loop that creates a certain number of JTextfields directly to the right of JSliders. Each JSlider has an anonymous inner class with a listener. So what I do on the listener is just go through the array and test if the corresponding JSlider is equal to the source of the event. Then I write the value in the Slider to the JTextField with the array index equal to the index that I figured out comparing JSliders to the JSlider source. Basically, I know I have the correct index and the correct value, but it doesn't show up in the JTextField. Here's my code segment.
[code]
for(int i=0;i<numSliders;i++){
if(((JSlider)(ce.getSource())).equals(sliderArray)){
fieldArray.setText(Integer.toString(((JSlider)(ce.getSource())).getValue()));
fieldArray[0].setText("hi"); //this doesn't even work
System.out.println(i); //this prints the right index every time
System.out.println(Integer.toString(((JSlider)(ce.getSource())).getValue()));//this prints the right value every time
}//end of if
}//end of for>

