Can someone tell me which one do I use revalidate() or repaint(), if I want to replace the contents of a JPanel.
I tried using removeAll(), then adding my new content, then calling revalidate(). But it's not working. However, If I add a call to repaint() in addition to revalidate(), then it works fine. It's confusing me. Can someone help?