I'm not completely sure about this, but I know I did a go-around when I had this problem when I made a card program a long time ago.

Basically, have 2 JPanels. 1 JPanel will hold your drawing and...