I have a paint application and I draw on a JPanel. I want to be able to upload an image file in the JPanel area and then draw it. I can upload the file but cannot draw over it, because the image file is above the JPanel. I cannot draw anything on it.
Please help.
Override the
paintComponentmethod of theJPanelinstance. Therein, you will draw everything directly to it’sGraphicsobject; first draw the image and then draw whatever else you want over it.