jPanel within a jInternalFrame repainting issues
I am a teacher and am new to Java programming. I am working on a testing app where a jDesktopPane holds two jInternalFrames. One jInternalFrame is for multiple-choice type questions and the other is for short answer type questions. Each jInternalFrames holds a jPanel that is used to present a graphic for the question being asked. I get the image as an ImageIcon and use paintIcon to display the graphic in each jPanel. I override paintComponent in the jPanel and call super.paintComponent then paint the icon.
Problem1; Titled border gets clobbered when paintIcon is called even when the image is much smaller than the drawable area of the jPanel. This problem occurs for changes within the same jInternalFrame.
Problem 2; When I switch from one jInternalFrame to the other the image gets clobbered but the border is intact. I see the ImageIcon appear for a split-second but then it disappears.
In my search to solve this problem, I have seen quite a bit of info on similar issues. But nothing that quite matches my problems.
May I have your suggestions on where to start with a resolution?

