change the caption of a label
Assume in my program i have 2 labels called jLabel 1 and jLabel 2.Once i click on jLabel 1 i need to change the caption of jLabel 2.Can some one help me. Thanks
[181 byte] By [
jolaa] at [2007-10-3 3:32:36]

Here i have several labels. label 1,2,3,4. I click only on label 1,2,3 and label 4 dispaly message according the label i press.
jolaa at 2007-7-14 21:26:52 >

> Here i have several labels. label 1,2,3,4. I click> only on label 1,2,3 and > label 4 dispaly message according the label i press.public void actionPerformed(ActionEvent e) {lable4.setText( e.getSource().getText());}
> public void actionPerformed(ActionEvent e)
labels don't support ActionListeners. You will need to use a MouseListener and handle the mouseClicked() event.
> Though you most likely have to revalidate the container for the change to show.
When you change a property of the component it will repaint itself. You only use revalidate() when you add or remove a component from a container.