Here you can find the source of printImage(BufferedImage im, String title)
public static void printImage(BufferedImage im, String title)
//package com.java2s; //License from project: Open Source License import java.awt.image.BufferedImage; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; public class Main { public static void printImage(BufferedImage im, String title) { ImageIcon icon = new ImageIcon(im); JFrame frame = new JFrame(); frame.setTitle(title);//from w w w .java2 s . c om frame.setSize(im.getWidth(), im.getHeight()); JLabel lbl = new JLabel(); lbl.setIcon(icon); frame.add(lbl); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }