So in my program I set in the beginning a JLabel to it so now an image is on it. Now I need to remove that JLabel and put a new one instead of it. So I did:
frame.remove(test_loadingJL);
frame.add(test_lockScreenJL);
But when I look, it is still the first image and it doesn't update until I resize the actual window manually. Is there a way to update the frame so I don't have to do that?