How to save drawing in JComponent into tiff format? I only know how to save the whole Java file but I dont know how to save specific Jcomponent. Help me :-(
EDITED: Thanks guys, now I am able to save my drawing to Jpeg.
However I just wanted to save one of the component? The c.paintAll(bufferedImage.getGraphics());
seem to save the whole component. However, I just want to save this component c.add(new PaintSurface(), BorderLayout.CENTER);
without panel.add(saveBtn);
How can I do that? Thanks.
Container c = getContentPane();
c.setLayout(new BorderLayout());
Panel panel = new Panel();
panel.add(saveBtn);
c.add("South", panel);
c.setBackground(Color.WHITE);
c.add(new PaintSurface(), BorderLayout.CENTER);