Java BufferedImage Show showImage(BufferedImage im)

Here you can find the source of showImage(BufferedImage im)

Description

Show an image in a popup window.

License

Open Source License

Parameter

Parameter Description
im a parameter

Declaration

public static void showImage(BufferedImage im) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class Main {
    /**//from   www . j a  v a2  s.  c o m
     * Show an image in a popup window. Closing the window will stop the process.
     * @param im
     */
    public static void showImage(BufferedImage im) {
        JFrame jf = new JFrame();
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.getContentPane().add(new JLabel(new ImageIcon(im)));
        jf.getContentPane().setBackground(Color.black);
        ;
        jf.pack();
        jf.setVisible(true);
    }
}

Related

  1. printImage(BufferedImage im, String title)
  2. printImageFromComponents(final Component _rootComponent, final int _currentColumn, final BufferedImage _bi)
  3. show(final BufferedImage image, final int width, final int height)
  4. showBufferedImage(BufferedImage I)
  5. showImage(BufferedImage image, String title, boolean fitToScreen)
  6. showImage(BufferedImage img)
  7. showImage(BufferedImage img)
  8. showImage(final BufferedImage img, final HashMap inputHandles, final HashMap outputHandles)