Java examples for 2D Graphics:BufferedImage
display BufferedImage
//package com.java2s; import javax.swing.*; import java.awt.image.BufferedImage; public class Main { public static void displayImage(final BufferedImage image) { displayImage("", image); }/*w w w.j a v a 2 s .c om*/ public static void displayImage(final String windowTitle, final BufferedImage image) { new JFrame(windowTitle) { { final JLabel label = new JLabel("", new ImageIcon(image), 0); add(label); pack(); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setVisible(true); } }; } }