Refreshing containers

HiI currently have a JPanel with JLabels in it and I would like the Container to refresh when i push a button because when the button is pushed it adds another JLabel to the Panel, but it does not refresh the container so the new label does not show up..any ideas?
[278 byte] By [flyers414a] at [2007-11-27 6:13:54]
# 1
When you add (or remove) a component from a visible panel you need to revalidate() the panel.
camickra at 2007-7-12 17:22:53 > top of Java-index,Desktop,Core GUI APIs...
# 2
corrected based on camickr's recMessage was edited by: petes1234
petes1234a at 2007-7-12 17:22:53 > top of Java-index,Desktop,Core GUI APIs...
# 3
> would a call to validate work here?99% of the time validate() and revalidate() are interchangeable. I tend to use revalidate() because it was added when Swing was added to the JDK so I figure it must have been added for some reason.
camickra at 2007-7-12 17:22:53 > top of Java-index,Desktop,Core GUI APIs...
# 4

> 99% of the time validate() and revalidate() are

> interchangeable. I tend to use revalidate() because

> it was added when Swing was added to the JDK so I

> figure it must have been added for some reason.

Thanks. I posted my reply, and then saw that you had posted something different. Given our knowledge gap, I figured that mine was dead wrong and deleted the post. Glad to see that it's at least sometimes right.

petes1234a at 2007-7-12 17:22:53 > top of Java-index,Desktop,Core GUI APIs...