I have a paint program that allows the user to draw lines, boxes, text, or even JPEGs.
I want to be able to save images the user draws, however I am a little confused about how to go about turning the user's creation into a format I can easily work with (Image or BufferedImage).
The user draws their content on a JPanel (let's call this JPanel inputPanel). If the user clicks a button (lets call this button saveButton). a JFileChooser pops up asking where to save it to, then BAM, the creation is saved (I know how to save an Image programatically already).
Is there an easy way to cast or convert a JPanel into an Image or BufferedImage in this way?
Googling/searching StackOverFlow only gives solutions to drawing an Image onto a JPanel using setIcon(), which doesn't help.