I have loaded a jpg image in which I want to draw letters and circles, given a x,y coordinate.
I have been trying to figure out the paintIcon of the ImageIcon class
<
The pure-Java way is to use ImageIO to load the image as a BufferedImage. Then you can call createGraphics() to get a Graphics2D
object; you can then draw whatever you want onto the image.
You can use an ImageIcon
embedded in a JLabel
to do the displaying, and you can add a MouseListener
and/or a MouseMotionListener
to the JLabel
if you're trying to allow the user to edit the image.