Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法将 JPanel 的paintComponent 内容保存到 .png 文件中?最好使用 java.io 或其他一些内置库。谢谢。
java.awt.image.BufferedImage
java.awt.Graphics
BufferedImage.createGraphics()
Graphics
JPanel.paintComponent()
javax.imageio.ImageIO.write()