SyntaxFix
Write A Post
Hire A Developer
Questions
You may need to call frame.repaint() as well to force the frame to actually redraw itself. I've had issues before where I tried to repaint a component and it wasn't updating what was displayed until the parent's repaint() method was called.
frame.repaint()