JFrame
JPanel
DefaultTableModel
JScrollPane
。如何将整个JFrame
保存到图像文件?
答案 0 :(得分:2)
ImageIO
课程会帮助你。您需要的方法的签名是:
public static boolean write(RenderedImage im, String formatName, File output)
通过formatName
参数确定图片扩展名(。jpg,.png,.bmp等)。有关更多信息,请查看此帖:
http://www.java-tips.org/java-se-tips/java.awt/how-to-capture-screenshot.html