标签: java image swing io jpanel
有没有办法将JPanel的paintComponent内容保存到.png文件中?最好用java.io或其他一些内置库。感谢。
答案 0 :(得分:4)
java.awt.image.BufferedImage
java.awt.Graphics
BufferedImage.createGraphics()
Graphics
JPanel.paintComponent()
javax.imageio.ImageIO.write()