Visual Artifacts appearing on JPanel
I am trying to create a program with 2 JPanel using BorderLayout . The center panel is for random drawing of rectangle while the south panel is for the buttons. I am getting a weird image of the button on the top left corner of the JFrame whenever I hover the mouse cursor over the North or South button. I did some research and found out that this could be the reason for having a transparent background. I tried using super.paintComponent(g) for the panel but the rest of the rectangles drawn earlier disappear. I need the rectangles to stay in the JPanel but not the weird image on the top left. I