Hi, I am trying to make my own paint program. It uses canvas where user draws. How can I get image representation out of that canvas as bufferedimage so I can save it with imageio.write?

Create a new buffered image. Get its Graphics. Draw your canvas on the Graphics. (Use your existing paintComponent method and pass the BufferedImage's Graphics to it.)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.