List of utility methods to do BufferedImage from JPanel
BufferedImage | getBufferedImageFromPanel(JPanel panel) get Buffered Image From Panel BufferedImage image = null; image = new BufferedImage(panel.getWidth(), panel.getHeight(), BufferedImage.TYPE_INT_RGB); Graphics2D g = image.createGraphics(); g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); panel.paint(g); g.dispose(); return image; ... |