Java BufferedImage Show printImage(BufferedImage im, String title)

Here you can find the source of printImage(BufferedImage im, String title)

Description

print Image

License

Open Source License

Declaration

public static void printImage(BufferedImage im, String title) 

Method Source Code

//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);
    }
}

Related

  1. printImageFromComponents(final Component _rootComponent, final int _currentColumn, final BufferedImage _bi)
  2. show(final BufferedImage image, final int width, final int height)
  3. showBufferedImage(BufferedImage I)
  4. showImage(BufferedImage im)