I'm missing the export file code, but I have no clue as to what I need to add. I have a drawn image in a JPanel -> panel and want to save that image into my desktop. What do I need to add?
JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(panel);
I've added the following code to my paintComponent method:
bi = new BufferedImage(panel.getSize().width,panel.getSize().height,
BufferedImage.TYPE_INT_ARGB);
g = bi.createGraphics();
And then the Save Button does this... What else am I missing? Or doing incorrectly more so.
JFileChooser chooser = new JFileChooser();
chooser.showSaveDialog(panel);
try{ImageIO.write(bi,"png",new File("test.png"));}catch (Exception ex) {}