Here you can find the source of showImage(BufferedImage im)
Parameter | Description |
---|---|
im | a parameter |
public static void showImage(BufferedImage im)
//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); } }