JPanel - Refresh Problem
I have a simple JFrame with inside a JPanel, with inside 2 others JPanels.
The top-inside panel displays an image, the bottom-inside panel has a JSlider. The user can use the JSlider to "animate" the image (for every movement of the JSlider a new frame is loaded and displayed).
This is the current situation:
The problem is that, as soon as the user moves the JSlider, the top JPanel start to have some drawing / refresh problems: the JSlider is painted also in the top panel (just painted, is not usable).
As soon as the user resize the JFrame everything is again displayed correctly.
What can I do to avoid this issue?
I tried with repaint(), revalidate(), removeAll() and then add(...) but I was not able to solve this.
Thank you for your help!
You've got a bug in your code. The solution is to try to find the bug and then fix it.
Hint: If you need our help, then your next step would be to post the offending code. The best code would be a small compilable program that demonstrates the problem, an SSCCE