revalidate() is used to update changes made to the layout.
After changing the text you should only need to call repaint()