Here you can find the source of displayImageInWindow(BufferedImage image)
public static void displayImageInWindow(BufferedImage image)
//package com.java2s; import java.awt.*; public class Main { public static void displayImageInWindow(BufferedImage image) { // Use a JLabel in a JFrame to display the image javax.swing.JFrame frame = new javax.swing.JFrame(); javax.swing.JLabel label = new javax.swing.JLabel(new javax.swing.ImageIcon(image)); frame.getContentPane().add(label, BorderLayout.CENTER); frame.pack();/*from ww w .ja v a2 s.c o m*/ frame.setVisible(true); } }